From: Harald Eilertsen Date: Sun, 27 Sep 2020 11:11:22 +0000 (+0200) Subject: gui/application: replace foreach (#2219) X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~137^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5bd2529ca60b03cf269ee9a16e40e98d45ee907e;p=nextcloud-desktop.git gui/application: replace foreach (#2219) Signed-off-by: Harald Eilertsen --- diff --git a/src/gui/application.cpp b/src/gui/application.cpp index d6345b9fa..ca42c0cc4 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -241,7 +241,7 @@ Application::Application(int &argc, char **argv) this, &Application::slotAccountStateAdded); connect(AccountManager::instance(), &AccountManager::accountRemoved, this, &Application::slotAccountStateRemoved); - foreach (auto ai, AccountManager::instance()->accounts()) { + for (const auto &ai : AccountManager::instance()->accounts()) { slotAccountStateAdded(ai.data()); } @@ -349,8 +349,8 @@ void Application::slotSystemOnlineConfigurationChanged(QNetworkConfiguration cnf void Application::slotCheckConnection() { - auto list = AccountManager::instance()->accounts(); - foreach (const auto &accountState, list) { + const auto &list = AccountManager::instance()->accounts(); + for (const auto &accountState : list) { AccountState::State state = accountState->state(); // Don't check if we're manually signed out or @@ -612,7 +612,7 @@ void Application::setupTranslations() auto *qtTranslator = new QTranslator(this); auto *qtkeychainTranslator = new QTranslator(this); - foreach (QString lang, uiLanguages) { + for (QString lang : qAsConst(uiLanguages)) { lang.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 lang = substLang(lang); const QString trPath = applicationTrPath();