From a963a3220f98c5c5e5a69e41ed7120e2dc875cf4 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sat, 8 Jul 2023 14:46:07 +0200 Subject: [PATCH] Add support for ownCloud --- src/Files.App/Utils/Cloud/CloudDrivesDetector.cs | 8 +++++++- src/Files.Shared/Cloud/CloudProviders.cs | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs b/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs index 05c4062c04c8..96ada7be1ee2 100644 --- a/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs +++ b/src/Files.App/Utils/Cloud/CloudDrivesDetector.cs @@ -86,11 +86,13 @@ private static Task> DetectGenericCloudDrive() driveType = appName; } - // iCloud specific + // Drive specific if (driveType.StartsWith("iCloudDrive")) driveType = "iCloudDrive"; if (driveType.StartsWith("iCloudPhotos")) driveType = "iCloudPhotos"; + if (driveType.StartsWith("ownCloud")) + driveType = "ownCloud"; using var bagKey = clsidSubKey.OpenSubKey(@"Instance\InitPropertyBag"); var syncedFolder = (string)bagKey?.GetValue("TargetFolderPath"); @@ -109,6 +111,7 @@ private static Task> DetectGenericCloudDrive() "iCloudDrive" => CloudProviders.AppleCloudDrive, "iCloudPhotos" => CloudProviders.AppleCloudPhotos, "Creative Cloud Files" => CloudProviders.AdobeCreativeCloud, + "ownCloud" => CloudProviders.ownCloud, _ => null, }; if (driveID is null) @@ -117,6 +120,8 @@ private static Task> DetectGenericCloudDrive() } string nextCloudValue = (string)namespaceSubKey?.GetValue(string.Empty); + string ownCloudValue = (string)clsidSubKey?.GetValue(string.Empty); + results.Add(new CloudProvider(driveID.Value) { Name = driveID switch @@ -128,6 +133,7 @@ private static Task> DetectGenericCloudDrive() CloudProviders.AppleCloudDrive => $"iCloud Drive", CloudProviders.AppleCloudPhotos => $"iCloud Photos", CloudProviders.AdobeCreativeCloud => $"Creative Cloud Files", + CloudProviders.ownCloud => !string.IsNullOrEmpty(ownCloudValue) ? ownCloudValue : "ownCloud", _ => null }, SyncFolder = syncedFolder, diff --git a/src/Files.Shared/Cloud/CloudProviders.cs b/src/Files.Shared/Cloud/CloudProviders.cs index 4da8672533b0..257e6c94fcf3 100644 --- a/src/Files.Shared/Cloud/CloudProviders.cs +++ b/src/Files.Shared/Cloud/CloudProviders.cs @@ -22,6 +22,7 @@ public enum CloudProviders AdobeCreativeCloud, Nutstore, Seadrive, - Autodesk + Autodesk, + ownCloud, } } \ No newline at end of file