From 0387bfbb64cf206616f28d3f3dfb87154d9ff5b9 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 21 Jun 2021 21:31:07 +1000 Subject: [PATCH] update class name --- .../Storage/PluginJsonStorage.cs | 21 +++---------------- Flow.Launcher/PublicAPIInstance.cs | 2 +- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs b/Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs index 585770e0f..923a1a6b5 100644 --- a/Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs +++ b/Flow.Launcher.Infrastructure/Storage/PluginJsonStorage.cs @@ -3,9 +3,9 @@ using Flow.Launcher.Infrastructure.UserSettings; namespace Flow.Launcher.Infrastructure.Storage { - public class PluginJsonSettingStorage :JsonStorage where T : new() + public class PluginJsonStorage :JsonStorage where T : new() { - public PluginJsonSettingStorage() + public PluginJsonStorage() { // C# related, add python related below var dataType = typeof(T); @@ -16,25 +16,10 @@ namespace Flow.Launcher.Infrastructure.Storage FilePath = Path.Combine(DirectoryPath, $"{dataType.Name}{FileSuffix}"); } - public PluginJsonSettingStorage(T data) : this() + public PluginJsonStorage(T data) : this() { _data = data; } } - - public class PluginJsonStorage : JsonStrorage where T : new() - { - public PluginJsonStorage() - { - // C# releated, add python releated below - var dataType = typeof(T); - var assemblyName = typeof(T).Assembly.GetName().Name; - DirectoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName, Constant.Plugins, assemblyName); - Helper.ValidateDirectory(DirectoryPath); - - FilePath = Path.Combine(DirectoryPath, $"{dataType.Name}{FileSuffix}"); - } - } - } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 6502e735a..f3403696e 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -177,7 +177,7 @@ namespace Flow.Launcher public void SaveJsonStorage(T settings) where T : new() { var type = typeof(T); - _pluginJsonStorages[type] = new PluginJsonSettingStorage(settings); + _pluginJsonStorages[type] = new PluginJsonStorage(settings); ((PluginJsonStorage) _pluginJsonStorages[type]).Save(); }