mirror of
https://github.com/tnodir/fort
synced 2024-11-15 06:35:23 +00:00
UI: TrayIcon: Add checks
This commit is contained in:
parent
8b58732fa4
commit
112e6c77f1
@ -47,7 +47,7 @@ void updateComboBox(
|
||||
{
|
||||
int index = 0;
|
||||
for (const QString &name : names) {
|
||||
const QString iconPath = iconPaths.at(index);
|
||||
const QString &iconPath = iconPaths.at(index);
|
||||
|
||||
c->setItemText(index, name);
|
||||
c->setItemIcon(index, IconCache::icon(iconPath));
|
||||
|
@ -487,8 +487,12 @@ void TrayIcon::setupTrayMenuBlockTraffic()
|
||||
int index = 0;
|
||||
const QStringList iconPaths = FirewallConf::blockTrafficIconPaths();
|
||||
for (const QString &name : FirewallConf::blockTrafficNames()) {
|
||||
const QString iconPath = iconPaths.at(index);
|
||||
const auto &iniKey = blockTrafficIniKeys[index];
|
||||
const QString &iconPath = iconPaths.at(index);
|
||||
|
||||
if (Q_UNLIKELY(index >= std::size(blockTrafficIniKeys)))
|
||||
break;
|
||||
|
||||
const char *iniKey = blockTrafficIniKeys[index];
|
||||
|
||||
QAction *a = addAction(m_blockTrafficMenu, iconPath, /*receiver=*/nullptr,
|
||||
/*member=*/nullptr, ActionNone, /*checkable=*/true);
|
||||
@ -520,8 +524,12 @@ void TrayIcon::setupTrayMenuFilterMode()
|
||||
int index = 0;
|
||||
const QStringList iconPaths = FirewallConf::filterModeIconPaths();
|
||||
for (const QString &name : FirewallConf::filterModeNames()) {
|
||||
const QString iconPath = iconPaths.at(index);
|
||||
const auto &iniKey = filterModeIniKeys[index];
|
||||
const QString &iconPath = iconPaths.at(index);
|
||||
|
||||
if (Q_UNLIKELY(index >= std::size(filterModeIniKeys)))
|
||||
break;
|
||||
|
||||
const char *iniKey = filterModeIniKeys[index];
|
||||
|
||||
QAction *a = addAction(m_filterModeMenu, iconPath, /*receiver=*/nullptr, /*member=*/nullptr,
|
||||
ActionNone, /*checkable=*/true);
|
||||
|
Loading…
Reference in New Issue
Block a user