diff --git a/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp b/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp index c1bd04109..95a2c5d16 100644 --- a/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp +++ b/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp @@ -155,7 +155,8 @@ void SBI_IconsManager::mainWindowCreated(BrowserWindow* window) void SBI_IconsManager::mainWindowDeleted(BrowserWindow* window) { - foreach (QWidget* w, m_windows[window]) { + const auto windows = m_windows[window]; + for (QWidget* w : windows) { window->statusBar()->removeWidget(w); delete w; } diff --git a/src/plugins/StatusBarIcons/sbi_networkmanager.cpp b/src/plugins/StatusBarIcons/sbi_networkmanager.cpp index 9a5e8f63d..acafe7573 100644 --- a/src/plugins/StatusBarIcons/sbi_networkmanager.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkmanager.cpp @@ -44,7 +44,8 @@ void SBI_NetworkManager::loadSettings() { QSettings settings(m_settingsFile, QSettings::IniFormat); - foreach (const QString &group, settings.childGroups()) { + const auto groups = settings.childGroups(); + for (const QString &group : groups) { if (group.isEmpty()) { continue; } diff --git a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp index 91a417517..de679619f 100644 --- a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp +++ b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp @@ -38,7 +38,8 @@ void StatusBarIconsPlugin::init(InitState state, const QString &settingsPath) // Make sure icons are added also to already created windows if (state == LateInitState) { - foreach (BrowserWindow* window, mApp->windows()) { + const auto windows = mApp->windows(); + for (BrowserWindow* window : windows) { m_manager->mainWindowCreated(window); } } @@ -48,7 +49,8 @@ void StatusBarIconsPlugin::unload() { // Make sure icons are properly removed when unloading plugin (but not when closing app) if (!mApp->isClosing()) { - foreach (BrowserWindow* window, mApp->windows()) { + const auto windows = mApp->windows(); + for (BrowserWindow* window : windows) { m_manager->mainWindowDeleted(window); }