From: Harald Eilertsen Date: Sun, 27 Sep 2020 11:07:34 +0000 (+0200) Subject: gui/accountstate: Replace foreach (#2219) X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~137^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e343b4b94775e1989d3992722a657bcfefe34cad;p=nextcloud-desktop.git gui/accountstate: Replace foreach (#2219) Signed-off-by: Harald Eilertsen --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 517d452d2..62491c5db 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -761,8 +761,8 @@ void AccountSettings::slotAccountStateChanged() AccountPtr account = _accountState->account(); QUrl safeUrl(account->url()); safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI - FolderMan *folderMan = FolderMan::instance(); - foreach (Folder *folder, folderMan->map().values()) { + const auto &folders = FolderMan::instance()->map().values(); + for (Folder *folder : folders) { _model->slotUpdateFolderState(folder); } @@ -894,15 +894,16 @@ void AccountSettings::refreshSelectiveSyncStatus() QString msg; int cnt = 0; - foreach (Folder *folder, FolderMan::instance()->map().values()) { + const auto &folders = FolderMan::instance()->map().values(); + for (Folder *folder : folders) { if (folder->accountState() != _accountState) { continue; } bool ok = false; - auto undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok); + const auto &undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok); QString p; - foreach (const auto &it, undecidedList) { + for (const auto &it : undecidedList) { // FIXME: add the folder alias in a hoover hint. // folder->alias() + QLatin1String("/") if (cnt++) {