Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/Files.App/Utils/Cloud/CloudDrivesDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
"ownCloud" => CloudProviders.ownCloud,
"ProtonDrive" => CloudProviders.ProtonDrive,
"kDrive" => CloudProviders.kDrive,
"Lucid" => CloudProviders.LucidLink,
_ => null,
};

Expand All @@ -99,6 +100,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
var nextCloudValue = (string?)namespaceSubKey?.GetValue(string.Empty);
var ownCloudValue = (string?)clsidSubKey?.GetValue(string.Empty);
var kDriveValue = (string?)clsidSubKey?.GetValue(string.Empty);
var lucidLinkValue = (string?)clsidSubKey?.GetValue(string.Empty);

using var defaultIconKey = clsidSubKey?.OpenSubKey(@"DefaultIcon");
var iconPath = (string?)defaultIconKey?.GetValue(string.Empty);
Expand All @@ -116,21 +118,29 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
CloudProviders.ownCloud => !string.IsNullOrEmpty(ownCloudValue) ? ownCloudValue : "ownCloud",
CloudProviders.ProtonDrive => $"Proton Drive",
CloudProviders.kDrive => !string.IsNullOrEmpty(kDriveValue) ? kDriveValue : "kDrive",
CloudProviders.LucidLink => !string.IsNullOrEmpty(lucidLinkValue) ? lucidLinkValue : "lucidLink",
_ => null
},
SyncFolder = syncedFolder,
IconData = cloudProvider switch
{
CloudProviders.ProtonDrive => Win32Helper.ExtractSelectedIconsFromDLL(iconPath, new List<int>() { 32512 }).FirstOrDefault()?.IconData,
_ => null
}
IconData = GetIconData(iconPath)
});
}
}

return Task.FromResult<IEnumerable<ICloudProvider>>(results);
}

private static byte[]? GetIconData(string iconPath)
{
if (string.IsNullOrEmpty(iconPath) || !File.Exists(iconPath))
return null;

if (iconPath.EndsWith(".dll") || iconPath.EndsWith(".exe"))
return Win32Helper.ExtractSelectedIconsFromDLL(iconPath, new List<int>() { 32512 }).FirstOrDefault()?.IconData;

return File.ReadAllBytes(iconPath);
}

private static Task<IEnumerable<ICloudProvider>> DetectOneDrive()
{
using var oneDriveAccountsKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\OneDrive\Accounts");
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Utils/Cloud/Detector/CloudDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ private static IEnumerable<ICloudDetector> EnumerateDetectors()
yield return new BoxCloudDetector();
yield return new GenericCloudDetector();
yield return new SynologyDriveCloudDetector();
yield return new LucidLinkCloudDetector();
}
}
}
61 changes: 0 additions & 61 deletions src/Files.App/Utils/Cloud/Detector/LucidLinkCloudDetector.cs

This file was deleted.

Loading