From 9b920618077e41abbae9c9ca6b3cb7dbf0284701 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 6 Jul 2025 20:28:26 +0800 Subject: [PATCH] Check modified & use IDictionary --- Flow.Launcher.Core/Plugin/PluginManager.cs | 10 ++++++---- .../UserSettings/PluginSettings.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 7c352bd78..231a477f0 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -481,14 +481,16 @@ namespace Flow.Launcher.Core.Plugin return _homePlugins.Where(p => !PluginModified(p.Metadata.ID)).Any(p => p.Metadata.ID == id); } - public static Dictionary> GetPluginHotkeyInfo() + public static IDictionary> GetPluginHotkeyInfo() { - return _pluginHotkeyInfo; + return _pluginHotkeyInfo.Where(p => !PluginModified(p.Key.Metadata.ID)) + .ToDictionary(p => p.Key, p => p.Value); } - public static Dictionary> GetWindowPluginHotkeys() + public static IDictionary> GetWindowPluginHotkeys() { - return _windowPluginHotkeys; + // Here we do not need to check PluginModified since we will check it in hotkey events + return _windowPluginHotkeys.ToDictionary(p => p.Key, p => p.Value); } public static void UpdatePluginHotkeyInfoTranslations() diff --git a/Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs b/Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs index f9fc1e509..0e881005a 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs @@ -93,7 +93,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings /// Update plugin hotkey information in metadata and plugin setting. /// /// - public void UpdatePluginHotkeyInfo(Dictionary> hotkeyPluginInfo) + public void UpdatePluginHotkeyInfo(IDictionary> hotkeyPluginInfo) { foreach (var info in hotkeyPluginInfo) {