1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

StatusBarIcons: port foreach -> range-based for

Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
Juraj Oravec 2019-12-30 16:00:28 +01:00
parent 9de051fb20
commit ff94cf69da
No known key found for this signature in database
GPG Key ID: 63ACB65056BC8D07
3 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}