From 8593887184d253f400a5a3dd8e7b0484facd4f2c Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 19 Dec 2024 22:38:35 +0100 Subject: [PATCH] Rename OneDrive v2 (#5795) * Change displayname of OneDrive v2 Since OneDrive v1 is removed, there is no need to name the current backend `v2`. * Renamed everything but the protocol key --- .../OneDrive/{OneDriveV2.cs => OneDrive.cs} | 16 +++---- Duplicati/Library/Backend/OneDrive/Strings.cs | 44 +++++++++---------- Duplicati/Library/Backends/BackendModules.cs | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) rename Duplicati/Library/Backend/OneDrive/{OneDriveV2.cs => OneDrive.cs} (81%) diff --git a/Duplicati/Library/Backend/OneDrive/OneDriveV2.cs b/Duplicati/Library/Backend/OneDrive/OneDrive.cs similarity index 81% rename from Duplicati/Library/Backend/OneDrive/OneDriveV2.cs rename to Duplicati/Library/Backend/OneDrive/OneDrive.cs index b0d4ff5cd..1328c47bd 100644 --- a/Duplicati/Library/Backend/OneDrive/OneDriveV2.cs +++ b/Duplicati/Library/Backend/OneDrive/OneDrive.cs @@ -24,7 +24,7 @@ using Duplicati.Library.Interface; namespace Duplicati.Library.Backend { - public class OneDriveV2 : MicrosoftGraphBackend + public class OneDrive : MicrosoftGraphBackend { private const string DRIVE_ID_OPTION = "drive-id"; private const string DEFAULT_DRIVE_PATH = "/me/drive"; @@ -32,10 +32,10 @@ namespace Duplicati.Library.Backend private readonly string drivePath; - public OneDriveV2() { } // Constructor needed for dynamic loading to find it + public OneDrive() { } // Constructor needed for dynamic loading to find it - public OneDriveV2(string url, Dictionary options) - : base(url, OneDriveV2.PROTOCOL_KEY, options) + public OneDrive(string url, Dictionary options) + : base(url, OneDrive.PROTOCOL_KEY, options) { string driveId; if (options.TryGetValue(DRIVE_ID_OPTION, out driveId)) @@ -50,12 +50,12 @@ namespace Duplicati.Library.Backend public override string ProtocolKey { - get { return OneDriveV2.PROTOCOL_KEY; } + get { return OneDrive.PROTOCOL_KEY; } } public override string DisplayName { - get { return Strings.OneDriveV2.DisplayName; } + get { return Strings.OneDrive.DisplayName; } } protected override string DrivePath @@ -67,7 +67,7 @@ namespace Duplicati.Library.Backend { get { - return Strings.OneDriveV2.Description; + return Strings.OneDrive.Description; } } @@ -77,7 +77,7 @@ namespace Duplicati.Library.Backend { return new ICommandLineArgument[] { - new CommandLineArgument(DRIVE_ID_OPTION, CommandLineArgument.ArgumentType.String, Strings.OneDriveV2.DriveIdShort, Strings.OneDriveV2.DriveIdLong(DEFAULT_DRIVE_PATH)), + new CommandLineArgument(DRIVE_ID_OPTION, CommandLineArgument.ArgumentType.String, Strings.OneDrive.DriveIdShort, Strings.OneDrive.DriveIdLong(DEFAULT_DRIVE_PATH)), }; } } diff --git a/Duplicati/Library/Backend/OneDrive/Strings.cs b/Duplicati/Library/Backend/OneDrive/Strings.cs index ad17d0e3a..a08e1557d 100644 --- a/Duplicati/Library/Backend/OneDrive/Strings.cs +++ b/Duplicati/Library/Backend/OneDrive/Strings.cs @@ -1,23 +1,23 @@ -// Copyright (C) 2024, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +// Copyright (C) 2024, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using Duplicati.Library.Localization.Short; namespace Duplicati.Library.Backend.Strings { @@ -36,10 +36,10 @@ namespace Duplicati.Library.Backend.Strings public static string UseHttpClientShort { get { return LC.L(@"Whether the HttpClient class should be used"); } } } - internal static class OneDriveV2 + internal static class OneDrive { public static string Description(string mssadescription, string mssalink, string msopdescription, string msoplink) { return LC.L(@"Store files in Microsoft OneDrive or Microsoft OneDrive for Business via the Microsoft Graph API. Usage of this backend requires that you agree to the terms in {0} ({1}) and {2} ({3}).", mssadescription, mssalink, msopdescription, msoplink); } - public static string DisplayName { get { return LC.L(@"Microsoft OneDrive v2"); } } + public static string DisplayName { get { return LC.L(@"Microsoft OneDrive"); } } public static string DriveIdLong(string defaultDrive) { return LC.L(@"ID of the drive to store data in. If no drive is specified, the default OneDrive or OneDrive for Business drive will be used via '{0}'.", defaultDrive); } public static string DriveIdShort { get { return LC.L(@"Optional ID of the drive"); } } } diff --git a/Duplicati/Library/Backends/BackendModules.cs b/Duplicati/Library/Backends/BackendModules.cs index 2c3495caa..dfb302553 100644 --- a/Duplicati/Library/Backends/BackendModules.cs +++ b/Duplicati/Library/Backends/BackendModules.cs @@ -53,7 +53,7 @@ public static class BackendModules new Backend.Jottacloud(), new Backend.Mega.MegaBackend(), new Backend.MicrosoftGroup(), - new Backend.OneDriveV2(), + new Backend.OneDrive(), new Backend.OpenStack.OpenStackStorage(), new Backend.Rclone(), new Backend.S3(),