diff --git a/src/ui/form/tray/trayicon.cpp b/src/ui/form/tray/trayicon.cpp index e22e9b26..42cb849a 100644 --- a/src/ui/form/tray/trayicon.cpp +++ b/src/ui/form/tray/trayicon.cpp @@ -479,7 +479,7 @@ void TrayIcon::setupTrayMenuFilterMode() const QStringList iconPaths = FirewallConf::filterModeIconPaths(); for (const QString &name : FirewallConf::filterModeNames()) { const QString iconPath = iconPaths.at(index); - const QString hotKey = HotKey::filterModeHotKeys[index]; + const QString hotKey = HotKey::filterModes[index]; QAction *a = addAction(m_filterModeMenu, iconPath, /*receiver=*/nullptr, /*member=*/nullptr, ActionNone, /*checkable=*/true); diff --git a/src/ui/user/iniuser.cpp b/src/ui/user/iniuser.cpp index eb8c75c9..721cc535 100644 --- a/src/ui/user/iniuser.cpp +++ b/src/ui/user/iniuser.cpp @@ -1,5 +1,17 @@ #include "iniuser.h" +namespace HotKey { + +const char *const filterModes[] = { + filterModeAutoLearn, + filterModeAskToConnect, + filterModeBlock, + filterModeAllow, + filterModeIgnore, +}; + +} + IniUser::IniUser(Settings *settings) : MapSettings(settings) { } void IniUser::saveDefaultIni() diff --git a/src/ui/user/iniuser.h b/src/ui/user/iniuser.h index 1b71fe37..53a294ad 100644 --- a/src/ui/user/iniuser.h +++ b/src/ui/user/iniuser.h @@ -18,13 +18,13 @@ const char *const blockInetTraffic = "blockInetTraffic"; const char *const appGroupModifier = "appGroupModifier"; const char *const quit = "quit"; -const char *const filterModeHotKeys[] = { - "filterModeAutoLearn", - "filterModeAskToConnect", - "filterModeBlock", - "filterModeAllow", - "filterModeIgnore", -}; +const char *const filterModeAutoLearn = "filterModeAutoLearn"; +const char *const filterModeAskToConnect = "filterModeAskToConnect"; +const char *const filterModeBlock = "filterModeBlock"; +const char *const filterModeAllow = "filterModeAllow"; +const char *const filterModeIgnore = "filterModeIgnore"; + +extern const char *const filterModes[]; namespace Default { const char *const filter = "Ctrl+Alt+Shift+F";