11using System ;
22using System . IO ;
33
4- #pragma warning disable CA2211 // Non-constant fields should not be visible
5-
64namespace Flow . Launcher . Infrastructure . UserSettings
75{
86 public static class DataLocation
97 {
108 public const string PortableFolderName = "UserData" ;
119 public const string DeletionIndicatorFile = ".dead" ;
12- public static string PortableDataPath = Path . Combine ( Constant . ProgramDirectory , PortableFolderName ) ;
13- public static string RoamingDataPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "FlowLauncher" ) ;
10+ public static readonly string PortableDataPath = Path . Combine ( Constant . ProgramDirectory , PortableFolderName ) ;
11+ public static readonly string RoamingDataPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "FlowLauncher" ) ;
1412 public static string DataDirectory ( )
1513 {
1614 if ( PortableDataLocationInUse ( ) )
@@ -22,27 +20,27 @@ public static string DataDirectory()
2220 public static bool PortableDataLocationInUse ( )
2321 {
2422 if ( Directory . Exists ( PortableDataPath ) &&
25- ! File . Exists ( Path . Combine ( PortableDataPath , DeletionIndicatorFile ) )
23+ ! File . Exists ( Path . Combine ( PortableDataPath , DeletionIndicatorFile ) ) )
2624 return true ;
2725
2826 return false ;
2927 }
3028
31- public static string VersionLogDirectory => Path . Combine ( LogDirectory , Constant . Version ) ;
32- public static string LogDirectory => Path . Combine ( DataDirectory ( ) , Constant . Logs ) ;
29+ public static readonly string VersionLogDirectory = Path . Combine ( LogDirectory , Constant . Version ) ;
30+ public static readonly string LogDirectory = Path . Combine ( DataDirectory ( ) , Constant . Logs ) ;
3331
34- public static string CacheDirectory => Path . Combine ( DataDirectory ( ) , Constant . Cache ) ;
35- public static string SettingsDirectory => Path . Combine ( DataDirectory ( ) , Constant . Settings ) ;
36- public static string PluginsDirectory => Path . Combine ( DataDirectory ( ) , Constant . Plugins ) ;
37- public static string ThemesDirectory => Path . Combine ( DataDirectory ( ) , Constant . Themes ) ;
32+ public static readonly string CacheDirectory = Path . Combine ( DataDirectory ( ) , Constant . Cache ) ;
33+ public static readonly string SettingsDirectory = Path . Combine ( DataDirectory ( ) , Constant . Settings ) ;
34+ public static readonly string PluginsDirectory = Path . Combine ( DataDirectory ( ) , Constant . Plugins ) ;
35+ public static readonly string ThemesDirectory = Path . Combine ( DataDirectory ( ) , Constant . Themes ) ;
3836
39- public static string PluginSettingsDirectory => Path . Combine ( SettingsDirectory , Constant . Plugins ) ;
40- public static string PluginCacheDirectory => Path . Combine ( DataDirectory ( ) , Constant . Cache , Constant . Plugins ) ;
37+ public static readonly string PluginSettingsDirectory = Path . Combine ( SettingsDirectory , Constant . Plugins ) ;
38+ public static readonly string PluginCacheDirectory = Path . Combine ( DataDirectory ( ) , Constant . Cache , Constant . Plugins ) ;
4139
4240 public const string PythonEnvironmentName = "Python" ;
4341 public const string NodeEnvironmentName = "Node.js" ;
4442 public const string PluginEnvironments = "Environments" ;
4543 public const string PluginDeleteFile = "NeedDelete.txt" ;
46- public static string PluginEnvironmentsPath => Path . Combine ( DataDirectory ( ) , PluginEnvironments ) ;
44+ public static readonly string PluginEnvironmentsPath = Path . Combine ( DataDirectory ( ) , PluginEnvironments ) ;
4745 }
4846}
0 commit comments