From: Nicolas Fella Date: Sat, 21 Mar 2020 00:24:06 +0000 (+0100) Subject: Fix container detaching X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~284^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1afda2b8751bed8db10c3475b83794a851d9178e;p=nextcloud-desktop.git Fix container detaching Found by clazy Signed-off-by: Nicolas Fella --- diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index 21f8380ef..169a88e00 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -346,7 +346,8 @@ bool ExcludedFiles::reloadExcludeFiles() _fullRegexDir.clear(); bool success = true; - for (const auto& basePath : _excludeFiles.keys()) { + const auto keys = _excludeFiles.keys(); + for (const auto& basePath : keys) { for (const auto& file : _excludeFiles.value(basePath)) { success = loadExcludeFile(basePath, file); } @@ -667,7 +668,8 @@ void ExcludedFiles::prepare() _fullRegexFile.clear(); _fullRegexDir.clear(); - for (auto const & basePath : _allExcludes.keys()) + const auto keys = _allExcludes.keys(); + for (auto const & basePath : keys) prepare(basePath); } diff --git a/src/gui/networksettings.cpp b/src/gui/networksettings.cpp index d2436396d..ff80b05c7 100644 --- a/src/gui/networksettings.cpp +++ b/src/gui/networksettings.cpp @@ -182,7 +182,8 @@ void NetworkSettings::saveProxySettings() // start the sync. FolderMan::instance()->setDirtyProxy(); - for (auto account : AccountManager::instance()->accounts()) { + const auto accounts = AccountManager::instance()->accounts(); + for (auto account : accounts) { account->freshConnectionAttempt(); } } diff --git a/src/gui/wizard/webview.cpp b/src/gui/wizard/webview.cpp index 8c6d57c1a..6603820f4 100644 --- a/src/gui/wizard/webview.cpp +++ b/src/gui/wizard/webview.cpp @@ -145,7 +145,7 @@ void WebViewPageUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *reques QUrl url = request->requestUrl(); QString path = url.path(0).mid(1); // get undecoded path - QStringList parts = path.split("&"); + const QStringList parts = path.split("&"); QString server; QString user; diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 42e45b5c8..63626c30a 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -331,7 +331,7 @@ void SyncEngine::conflictRecordMaintenance() // Remove stale conflict entries from the database // by checking which files still exist and removing the // missing ones. - auto conflictRecordPaths = _journal->conflictRecordPaths(); + const auto conflictRecordPaths = _journal->conflictRecordPaths(); for (const auto &path : conflictRecordPaths) { auto fsPath = _propagator->getFilePath(QString::fromUtf8(path)); if (!QFileInfo(fsPath).exists()) { @@ -344,7 +344,7 @@ void SyncEngine::conflictRecordMaintenance() // // This happens when the conflicts table is new or when conflict files // are downlaoded but the server doesn't send conflict headers. - for (const auto &path : _seenFiles) { + for (const auto &path : qAsConst(_seenFiles)) { if (!Utility::isConflictFile(path)) continue;