55namespace lg2de . SimpleAccounting . Infrastructure ;
66
77using System ;
8+ using System . Diagnostics . CodeAnalysis ;
89using System . Globalization ;
910using System . Linq ;
1011using System . Threading . Tasks ;
@@ -15,9 +16,8 @@ namespace lg2de.SimpleAccounting.Infrastructure;
1516
1617internal class ProjectFileLoader
1718{
18- private readonly IFileSystem fileSystem ;
19-
2019 private readonly IDialogs dialogs ;
20+ private readonly IFileSystem fileSystem ;
2121 private readonly IProcess processApi ;
2222 private readonly Settings settings ;
2323
@@ -155,14 +155,19 @@ private bool LoadFile(string projectFileName, out bool autoSaveFileLoaded)
155155 return true ;
156156 }
157157
158+ [ SuppressMessage (
159+ "Minor Code Smell" ,
160+ "S6605:Collection-specific \" Exists\" method should be used instead of the \" Any\" extension" ,
161+ Justification = "FP" ) ]
158162 private void UpdateSettings ( string projectFileName )
159163 {
160164 this . settings . RecentProject = projectFileName ;
161165
162166 var info = this . fileSystem . GetDrives ( ) . SingleOrDefault (
163167 x => projectFileName . StartsWith ( x . RootPath , StringComparison . InvariantCultureIgnoreCase ) ) ;
164168 string format = info . GetFormat ? . Invoke ( ) ?? string . Empty ;
165- if ( format . Contains ( "cryptomator" , StringComparison . InvariantCultureIgnoreCase )
169+ var identifiers = new [ ] { "cryptomator" , "cryptoFs" } ;
170+ if ( identifiers . Any ( x => format . Contains ( x , StringComparison . InvariantCultureIgnoreCase ) )
166171 && ! this . settings . SecuredDrives . Contains ( info . RootPath ) )
167172 {
168173 this . settings . SecuredDrives . Add ( info . RootPath ) ;
0 commit comments