Skip to content

Commit 6012111

Browse files
committed
Add log directory & version log directory & themes directory in data location
1 parent b50db58 commit 6012111

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

Flow.Launcher.Infrastructure/Logger/Log.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Flow.Launcher.Infrastructure.Logger
1212
{
1313
public static class Log
1414
{
15-
public const string DirectoryName = "Logs";
15+
public const string DirectoryName = Constant.Logs;
1616

1717
public static string CurrentLogDirectory { get; }
1818

Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ public static bool PortableDataLocationInUse()
2525
return false;
2626
}
2727

28+
public static readonly string VersionLogDirectory = Path.Combine(LogDirectory, Constant.Version);
29+
30+
public static readonly string LogDirectory = Path.Combine(DataDirectory(), Constant.Logs);
2831
public static readonly string SettingsDirectorty = Path.Combine(DataDirectory(), Constant.Settings);
2932
public static readonly string PluginsDirectory = Path.Combine(DataDirectory(), Constant.Plugins);
33+
public static readonly string ThemesDirectory = Path.Combine(DataDirectory(), Constant.Themes);
3034

3135
public static readonly string PluginSettingsDirectory = Path.Combine(SettingsDirectorty, Constant.Plugins);
3236
public static readonly string PluginCacheDirectory = Path.Combine(DataDirectory(), Constant.Cache, Constant.Plugins);

Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private void ClearLogFolder()
115115

116116
private static DirectoryInfo GetLogDir(string version = "")
117117
{
118-
return new DirectoryInfo(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, version));
118+
return new DirectoryInfo(Path.Combine(DataLocation.LogDirectory, version));
119119
}
120120

121121
private static List<FileInfo> GetLogFiles(string version = "")

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public FamilyTypeface SelectedResultSubFontFaces
420420
[RelayCommand]
421421
private void OpenThemesFolder()
422422
{
423-
App.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
423+
App.API.OpenDirectory(DataLocation.ThemesDirectory);
424424
}
425425

426426
public void UpdateColorScheme()

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ private static unsafe bool EnableShutdownPrivilege()
147147
private List<Result> Commands()
148148
{
149149
var results = new List<Result>();
150-
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
151-
var userDataPath = DataLocation.DataDirectory();
152150
var recycleBinFolder = "shell:RecycleBinFolder";
153151
results.AddRange(new[]
154152
{
@@ -406,11 +404,11 @@ private List<Result> Commands()
406404
Title = "Open Log Location",
407405
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location"),
408406
IcoPath = "Images\\app.png",
409-
CopyText = logPath,
410-
AutoCompleteText = logPath,
407+
CopyText = DataLocation.VersionLogDirectory,
408+
AutoCompleteText = DataLocation.VersionLogDirectory,
411409
Action = c =>
412410
{
413-
context.API.OpenDirectory(logPath);
411+
context.API.OpenDirectory(DataLocation.VersionLogDirectory);
414412
return true;
415413
}
416414
},
@@ -432,11 +430,11 @@ private List<Result> Commands()
432430
Title = "Flow Launcher UserData Folder",
433431
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location"),
434432
IcoPath = "Images\\app.png",
435-
CopyText = userDataPath,
436-
AutoCompleteText = userDataPath,
433+
CopyText = DataLocation.DataDirectory(),
434+
AutoCompleteText = DataLocation.DataDirectory(),
437435
Action = c =>
438436
{
439-
context.API.OpenDirectory(userDataPath);
437+
context.API.OpenDirectory(DataLocation.DataDirectory());
440438
return true;
441439
}
442440
},

0 commit comments

Comments
 (0)