mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Refactoring CustomizedPluginConfig
1. Reorder the sequence of initialization of UserSettings. 2. Use dictionary for CustomizedPluginConfigs, so code logic like `.FirstOrDefault(o => o.ID == id);` are removed 3. part of #389
This commit is contained in:
@@ -14,9 +14,8 @@ namespace Wox.Plugin.PluginIndicator
|
||||
var results = from keyword in PluginManager.NonGlobalPlugins.Keys
|
||||
where keyword.StartsWith(query.Terms[0])
|
||||
let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
|
||||
let customizedPluginConfig =
|
||||
UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == metadata.ID)
|
||||
where customizedPluginConfig == null || !customizedPluginConfig.Disabled
|
||||
let customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs[metadata.ID]
|
||||
where !customizedPluginConfig.Disabled
|
||||
select new Result
|
||||
{
|
||||
Title = keyword,
|
||||
|
||||
Reference in New Issue
Block a user