From 541e91df605496edf7ae041ca1eb90f241dfecb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Thu, 18 Mar 2021 11:38:07 +0800 Subject: [PATCH 1/7] Move initialization of BrowserBookmark to Init() --- Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index b889bb0d0ff..df87d14e762 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -23,15 +23,17 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, ISavabl public Main() { - _storage = new PluginJsonStorage(); - _settings = _storage.Load(); - - cachedBookmarks = Bookmarks.LoadAllBookmarks(); + } public void Init(PluginInitContext context) { this.context = context; + + _storage = new PluginJsonStorage(); + _settings = _storage.Load(); + + cachedBookmarks = Bookmarks.LoadAllBookmarks(); } public List Query(Query query) From 409ccae7f20ddeceaaedad65c5110460c72b7ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Thu, 18 Mar 2021 11:39:13 +0800 Subject: [PATCH 2/7] Move initialization of Calculator to Init() --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index ab8ce892a7f..7ee69494ada 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -32,13 +32,7 @@ public class Main : IPlugin, IPluginI18n, ISavable, ISettingProvider static Main() { - MagesEngine = new Engine(new Configuration - { - Scope = new Dictionary - { - { "e", Math.E }, // e is not contained in the default mages engine - } - }); + } public void Init(PluginInitContext context) @@ -47,6 +41,14 @@ public void Init(PluginInitContext context) _viewModel = new SettingsViewModel(); _settings = _viewModel.Settings; + + MagesEngine = new Engine(new Configuration + { + Scope = new Dictionary + { + { "e", Math.E }, // e is not contained in the default mages engine + } + }); } public List Query(Query query) From 6430e2562d974cbab9677ebd38e4ca345f937535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Thu, 18 Mar 2021 11:43:41 +0800 Subject: [PATCH 3/7] Use EnumerateDirectories instead of GetDirectories --- Flow.Launcher.Core/Plugin/PluginConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginConfig.cs b/Flow.Launcher.Core/Plugin/PluginConfig.cs index 46f79c60cad..ea2119e60bc 100644 --- a/Flow.Launcher.Core/Plugin/PluginConfig.cs +++ b/Flow.Launcher.Core/Plugin/PluginConfig.cs @@ -20,7 +20,7 @@ internal abstract class PluginConfig public static List Parse(string[] pluginDirectories) { var allPluginMetadata = new List(); - var directories = pluginDirectories.SelectMany(Directory.GetDirectories); + var directories = pluginDirectories.SelectMany(Directory.EnumerateDirectories); // todo use linq when diable plugin is implmented since parallel.foreach + list is not thread saft foreach (var directory in directories) From 8acde564554aa7322dc1359712fba9bbaa9d0162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Thu, 18 Mar 2021 11:59:48 +0800 Subject: [PATCH 4/7] remove readonly field to allow init in Init() --- Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index df87d14e762..5bff0e182fc 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -18,13 +18,8 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, ISavabl private List cachedBookmarks = new List(); - private readonly Settings _settings; - private readonly PluginJsonStorage _storage; - - public Main() - { - - } + private Settings _settings { get; set;} + private PluginJsonStorage _storage { get; set;} public void Init(PluginInitContext context) { From 9182fdb2bd286691fac9c519e460186bd533b0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Sat, 20 Mar 2021 18:02:35 +0800 Subject: [PATCH 5/7] Remove readonly in Calculator --- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 7ee69494ada..3c60bbf5a76 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -24,7 +24,7 @@ public class Main : IPlugin, IPluginI18n, ISavable, ISettingProvider @"[ei]|[0-9]|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + @")+$", RegexOptions.Compiled); private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); - private static readonly Engine MagesEngine; + private static Engine MagesEngine; private PluginInitContext Context { get; set; } private static Settings _settings; From 480887edaf341061b2d031739a8895fb5278fd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Sat, 20 Mar 2021 18:03:11 +0800 Subject: [PATCH 6/7] Version Bump --- Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 9bf532e8791..d37a1d28218 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -4,7 +4,7 @@ "Name": "Calculator", "Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)", "Author": "cxfksword", - "Version": "1.1.5", + "Version": "1.1.6", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll", From c8c28db624491cb5e64a5cf954e19ddc110e3a3a Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 22 Mar 2021 05:01:45 +1100 Subject: [PATCH 7/7] version bump BrowserBookmarks plugin --- Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json index 62311f51458..e3ef792ecc8 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json @@ -4,7 +4,7 @@ "Name": "Browser Bookmarks", "Description": "Search your browser bookmarks", "Author": "qianlifeng, Ioannis G.", - "Version": "1.4.0", + "Version": "1.4.1", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll",