From cd3eebaac62d326a81d060f7db1e6f2f1100df80 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 2 Jul 2025 18:02:50 +0800 Subject: [PATCH] Remove used functions --- .../Views/SettingsPaneHotkey.xaml.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs index e32bc2dbe..a21d4ae97 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml.cs @@ -5,7 +5,6 @@ using System.Windows.Navigation; using CommunityToolkit.Mvvm.DependencyInjection; using CommunityToolkit.Mvvm.Input; using Flow.Launcher.Core.Plugin; -using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin; using Flow.Launcher.Resources.Controls; @@ -81,12 +80,13 @@ public partial class SettingsPaneHotkey var hotkeyControl = new HotkeyControl { Type = hotkey.HotkeyType == HotkeyType.Global ? - HotkeyControl.HotkeyType.GlobalPluginHotkey : HotkeyControl.HotkeyType.WindowPluginHotkey, + HotkeyControl.HotkeyType.GlobalPluginHotkey : + HotkeyControl.HotkeyType.WindowPluginHotkey, DefaultHotkey = hotkey.DefaultHotkey, ValidateKeyGesture = true }; hotkeyControl.SetHotkey(hotkeySetting, true); - hotkeyControl.ChangeHotkey = new RelayCommand((m) => ChangePluginHotkey(metadata, hotkey, m)); + hotkeyControl.ChangeHotkey = new RelayCommand((h) => ChangePluginHotkey(metadata, hotkey, h)); card.Content = hotkeyControl; } else @@ -108,18 +108,11 @@ public partial class SettingsPaneHotkey { if (pluginHotkey is GlobalPluginHotkey globalPluginHotkey) { - var oldHotkey = PluginManager.ChangePluginHotkey(metadata, globalPluginHotkey, newHotkey); - HotKeyMapper.RemoveHotkey(oldHotkey); - HotKeyMapper.SetGlobalPluginHotkey(globalPluginHotkey, metadata, newHotkey); + PluginManager.ChangePluginHotkey(metadata, globalPluginHotkey, newHotkey); } else if (pluginHotkey is SearchWindowPluginHotkey windowPluginHotkey) { - var (oldHotkeyModel, newHotkeyModel) = PluginManager.ChangePluginHotkey(metadata, windowPluginHotkey, newHotkey); - var windowPluginHotkeys = PluginManager.GetWindowPluginHotkeys(); - HotKeyMapper.RemoveWindowHotkey(oldHotkeyModel); - HotKeyMapper.RemoveWindowHotkey(newHotkeyModel); - HotKeyMapper.SetWindowHotkey(oldHotkeyModel, windowPluginHotkeys[oldHotkeyModel]); - HotKeyMapper.SetWindowHotkey(newHotkeyModel, windowPluginHotkeys[newHotkeyModel]); + PluginManager.ChangePluginHotkey(metadata, windowPluginHotkey, newHotkey); } } }