gui/application: replace foreach (#2219)
authorHarald Eilertsen <haraldei@anduin.net>
Sun, 27 Sep 2020 11:11:22 +0000 (13:11 +0200)
committerHarald Eilertsen <haraldei@anduin.net>
Tue, 29 Sep 2020 17:31:23 +0000 (19:31 +0200)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
src/gui/application.cpp

index d6345b9fafca5cd818fdce4731c5edb6413a4778..ca42c0cc4755c9220f89372965a7f962abf6b716 100644 (file)
@@ -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();