@@ -90,6 +90,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
9090 "ownCloud" => CloudProviders . ownCloud ,
9191 "ProtonDrive" => CloudProviders . ProtonDrive ,
9292 "kDrive" => CloudProviders . kDrive ,
93+ "Lucid" => CloudProviders . LucidLink ,
9394 _ => null ,
9495 } ;
9596
@@ -99,6 +100,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
99100 var nextCloudValue = ( string ? ) namespaceSubKey ? . GetValue ( string . Empty ) ;
100101 var ownCloudValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
101102 var kDriveValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
103+ var lucidLinkValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
102104
103105 using var defaultIconKey = clsidSubKey ? . OpenSubKey ( @"DefaultIcon" ) ;
104106 var iconPath = ( string ? ) defaultIconKey ? . GetValue ( string . Empty ) ;
@@ -116,21 +118,29 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
116118 CloudProviders . ownCloud => ! string . IsNullOrEmpty ( ownCloudValue ) ? ownCloudValue : "ownCloud" ,
117119 CloudProviders . ProtonDrive => $ "Proton Drive",
118120 CloudProviders . kDrive => ! string . IsNullOrEmpty ( kDriveValue ) ? kDriveValue : "kDrive" ,
121+ CloudProviders . LucidLink => ! string . IsNullOrEmpty ( lucidLinkValue ) ? lucidLinkValue : "lucidLink" ,
119122 _ => null
120123 } ,
121124 SyncFolder = syncedFolder ,
122- IconData = cloudProvider switch
123- {
124- CloudProviders . ProtonDrive => Win32Helper . ExtractSelectedIconsFromDLL ( iconPath , new List < int > ( ) { 32512 } ) . FirstOrDefault ( ) ? . IconData ,
125- _ => null
126- }
125+ IconData = GetIconData ( iconPath )
127126 } ) ;
128127 }
129128 }
130129
131130 return Task . FromResult < IEnumerable < ICloudProvider > > ( results ) ;
132131 }
133132
133+ private static byte [ ] ? GetIconData ( string iconPath )
134+ {
135+ if ( string . IsNullOrEmpty ( iconPath ) || ! File . Exists ( iconPath ) )
136+ return null ;
137+
138+ if ( iconPath . EndsWith ( ".dll" ) || iconPath . EndsWith ( ".exe" ) )
139+ return Win32Helper . ExtractSelectedIconsFromDLL ( iconPath , new List < int > ( ) { 32512 } ) . FirstOrDefault ( ) ? . IconData ;
140+
141+ return File . ReadAllBytes ( iconPath ) ;
142+ }
143+
134144 private static Task < IEnumerable < ICloudProvider > > DetectOneDrive ( )
135145 {
136146 using var oneDriveAccountsKey = Registry . CurrentUser . OpenSubKey ( @"SOFTWARE\Microsoft\OneDrive\Accounts" ) ;
0 commit comments