Skip to content

Commit b6ecfdc

Browse files
committed
Remove project reference in Sys plugin to Flow.Launcher.Infrastructure
1 parent 96e6882 commit b6ecfdc

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,5 +613,17 @@ public interface IPublicAPI
613613
/// Invoked when the actual theme of the application has changed. Currently, the plugin will continue to be subscribed even if it is turned off.
614614
/// </summary>
615615
event ActualApplicationThemeChangedEventHandler ActualApplicationThemeChanged;
616+
617+
/// <summary>
618+
/// Get the data directory of Flow Launcher.
619+
/// </summary>
620+
/// <returns></returns>
621+
string GetDataDirectory();
622+
623+
/// <summary>
624+
/// Get the log directory of Flow Launcher.
625+
/// </summary>
626+
/// <returns></returns>
627+
string GetLogDirectory();
616628
}
617629
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@ public event ActualApplicationThemeChangedEventHandler ActualApplicationThemeCha
599599
remove => _mainVM.ActualApplicationThemeChanged -= value;
600600
}
601601

602+
public string GetDataDirectory() => DataLocation.DataDirectory();
603+
604+
public string GetLogDirectory() => DataLocation.VersionLogDirectory;
605+
602606
#endregion
603607

604608
#region Private Methods

Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
</PropertyGroup>
3838

3939
<ItemGroup>
40-
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" />
4140
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
4241
</ItemGroup>
4342

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using System.Linq;
66
using System.Runtime.InteropServices;
77
using System.Windows;
8-
using Flow.Launcher.Infrastructure;
9-
using Flow.Launcher.Infrastructure.UserSettings;
108
using Windows.Win32;
119
using Windows.Win32.Foundation;
1210
using Windows.Win32.Security;
@@ -52,6 +50,8 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n
5250
private const SHUTDOWN_REASON REASON = SHUTDOWN_REASON.SHTDN_REASON_MAJOR_OTHER |
5351
SHUTDOWN_REASON.SHTDN_REASON_FLAG_PLANNED;
5452

53+
private const string Documentation = "https://flowlauncher.com/docs/#/usage-tips";
54+
5555
private PluginInitContext _context;
5656
private Settings _settings;
5757
private ThemeSelector _themeSelector;
@@ -445,11 +445,11 @@ private List<Result> Commands(Query query)
445445
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"),
446446
Title = "Open Log Location",
447447
IcoPath = "Images\\app.png",
448-
CopyText = DataLocation.VersionLogDirectory,
449-
AutoCompleteText = DataLocation.VersionLogDirectory,
448+
CopyText = _context.API.GetLogDirectory(),
449+
AutoCompleteText = _context.API.GetLogDirectory(),
450450
Action = c =>
451451
{
452-
_context.API.OpenDirectory(DataLocation.VersionLogDirectory);
452+
_context.API.OpenDirectory(_context.API.GetLogDirectory());
453453
return true;
454454
}
455455
},
@@ -458,11 +458,11 @@ private List<Result> Commands(Query query)
458458
Title = "Flow Launcher Tips",
459459
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe897"),
460460
IcoPath = "Images\\app.png",
461-
CopyText = Constant.Documentation,
462-
AutoCompleteText = Constant.Documentation,
461+
CopyText = Documentation,
462+
AutoCompleteText = Documentation,
463463
Action = c =>
464464
{
465-
_context.API.OpenUrl(Constant.Documentation);
465+
_context.API.OpenUrl(Documentation);
466466
return true;
467467
}
468468
},
@@ -471,11 +471,11 @@ private List<Result> Commands(Query query)
471471
Title = "Flow Launcher UserData Folder",
472472
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"),
473473
IcoPath = "Images\\app.png",
474-
CopyText = DataLocation.DataDirectory(),
475-
AutoCompleteText = DataLocation.DataDirectory(),
474+
CopyText = _context.API.GetDataDirectory(),
475+
AutoCompleteText = _context.API.GetDataDirectory(),
476476
Action = c =>
477477
{
478-
_context.API.OpenDirectory(DataLocation.DataDirectory());
478+
_context.API.OpenDirectory(_context.API.GetDataDirectory());
479479
return true;
480480
}
481481
},

0 commit comments

Comments
 (0)