mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #389 from Flow-Launcher/optimizeStartup
Optimize startup
This commit is contained in:
commit
b5e54a76b0
5 changed files with 20 additions and 21 deletions
|
|
@ -20,7 +20,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
public static List<PluginMetadata> Parse(string[] pluginDirectories)
|
||||
{
|
||||
var allPluginMetadata = new List<PluginMetadata>();
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -18,20 +18,17 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
|
|||
|
||||
private List<Bookmark> cachedBookmarks = new List<Bookmark>();
|
||||
|
||||
private readonly Settings _settings;
|
||||
private readonly PluginJsonStorage<Settings> _storage;
|
||||
|
||||
public Main()
|
||||
{
|
||||
_storage = new PluginJsonStorage<Settings>();
|
||||
_settings = _storage.Load();
|
||||
|
||||
cachedBookmarks = Bookmarks.LoadAllBookmarks();
|
||||
}
|
||||
private Settings _settings { get; set;}
|
||||
private PluginJsonStorage<Settings> _storage { get; set;}
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
{
|
||||
this.context = context;
|
||||
|
||||
_storage = new PluginJsonStorage<Settings>();
|
||||
_settings = _storage.Load();
|
||||
|
||||
cachedBookmarks = Bookmarks.LoadAllBookmarks();
|
||||
}
|
||||
|
||||
public List<Result> Query(Query query)
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Flow.Launcher.Plugin.Caculator
|
|||
@"[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;
|
||||
|
|
@ -32,13 +32,7 @@ namespace Flow.Launcher.Plugin.Caculator
|
|||
|
||||
static Main()
|
||||
{
|
||||
MagesEngine = new Engine(new Configuration
|
||||
{
|
||||
Scope = new Dictionary<string, object>
|
||||
{
|
||||
{ "e", Math.E }, // e is not contained in the default mages engine
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
|
|
@ -47,6 +41,14 @@ namespace Flow.Launcher.Plugin.Caculator
|
|||
|
||||
_viewModel = new SettingsViewModel();
|
||||
_settings = _viewModel.Settings;
|
||||
|
||||
MagesEngine = new Engine(new Configuration
|
||||
{
|
||||
Scope = new Dictionary<string, object>
|
||||
{
|
||||
{ "e", Math.E }, // e is not contained in the default mages engine
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<Result> Query(Query query)
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue