Skip to content

Commit 3efe550

Browse files
committed
Use context plugin settings path
1 parent 6012111 commit 3efe550

File tree

5 files changed

+5
-22
lines changed

5 files changed

+5
-22
lines changed

Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ private IEnumerable<PluginPair> SetPathForPluginPairs(string filePath, string la
115115
{
116116
if (metadata.Language.Equals(languageToSet, StringComparison.OrdinalIgnoreCase))
117117
{
118-
pluginPairs.Add(CreatePluginPair(filePath, metadata));
119118
metadata.AssemblyName = string.Empty;
120119
metadata.PluginSettingsDirectoryPath = Path.Combine(DataLocation.PluginSettingsDirectory, metadata.Name);
121120
metadata.PluginCacheDirectoryPath = Path.Combine(DataLocation.PluginCacheDirectory, metadata.Name);
121+
122+
pluginPairs.Add(CreatePluginPair(filePath, metadata));
122123
}
123124
}
124125

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Threading;
99
using System.Threading.Tasks;
1010
using Flow.Launcher.Infrastructure.Logger;
11-
using Flow.Launcher.Infrastructure.UserSettings;
1211
using Flow.Launcher.Plugin;
1312
using Microsoft.IO;
1413
using System.Windows;
@@ -31,7 +30,7 @@ internal abstract class JsonRPCPlugin : JsonRPCPluginBase
3130
private int RequestId { get; set; }
3231

3332
private string SettingConfigurationPath => Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "SettingsTemplate.yaml");
34-
private string SettingPath => Path.Combine(DataLocation.PluginSettingsDirectory, Context.CurrentPluginMetadata.Name, "Settings.json");
33+
private string SettingPath => Path.Combine(Context.CurrentPluginMetadata.PluginSettingsDirectoryPath, "Settings.json");
3534

3635
public override List<Result> LoadContextMenus(Result selectedResult)
3736
{

Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Text.Json;
77
using System.Threading;
88
using System.Threading.Tasks;
9-
using Flow.Launcher.Infrastructure.UserSettings;
109
using Flow.Launcher.Plugin;
1110
using YamlDotNet.Serialization;
1211
using YamlDotNet.Serialization.NamingConventions;
@@ -28,8 +27,7 @@ internal abstract class JsonRPCPluginBase : IAsyncPlugin, IContextMenu, ISetting
2827
private string SettingConfigurationPath =>
2928
Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "SettingsTemplate.yaml");
3029

31-
private string SettingDirectory => Path.Combine(DataLocation.PluginSettingsDirectory,
32-
Context.CurrentPluginMetadata.Name);
30+
private string SettingDirectory => Context.CurrentPluginMetadata.PluginSettingsDirectoryPath;
3331

3432
private string SettingPath => Path.Combine(SettingDirectory, "Settings.json");
3533

@@ -145,13 +143,5 @@ public Control CreateSettingPanel()
145143
{
146144
return Settings.CreateSettingPanel();
147145
}
148-
149-
public void DeletePluginSettingsDirectory()
150-
{
151-
if (Directory.Exists(SettingDirectory))
152-
{
153-
Directory.Delete(SettingDirectory, true);
154-
}
155-
}
156146
}
157147
}

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
7575

7676
plugin = Activator.CreateInstance(type) as IAsyncPlugin;
7777

78+
// Same as PluginJsonStorage.cs constructor
7879
var assemblyName = assembly.GetName().Name;
7980
metadata.AssemblyName = assemblyName;
8081
metadata.PluginSettingsDirectoryPath = Path.Combine(DataLocation.PluginSettingsDirectory, assemblyName);

Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,5 @@ public PluginJsonStorage(T data) : this()
2323
{
2424
Data = data;
2525
}
26-
27-
public void DeleteDirectory()
28-
{
29-
if (Directory.Exists(DirectoryPath))
30-
{
31-
Directory.Delete(DirectoryPath, true);
32-
}
33-
}
3426
}
3527
}

0 commit comments

Comments
 (0)