Fix container detaching

Found by clazy

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
This commit is contained in:
Nicolas Fella 2020-03-21 01:24:06 +01:00
parent 3ca586c464
commit 1afda2b875
4 changed files with 9 additions and 6 deletions

View file

@ -346,7 +346,8 @@ bool ExcludedFiles::reloadExcludeFiles()
_fullRegexDir.clear(); _fullRegexDir.clear();
bool success = true; 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)) { for (const auto& file : _excludeFiles.value(basePath)) {
success = loadExcludeFile(basePath, file); success = loadExcludeFile(basePath, file);
} }
@ -667,7 +668,8 @@ void ExcludedFiles::prepare()
_fullRegexFile.clear(); _fullRegexFile.clear();
_fullRegexDir.clear(); _fullRegexDir.clear();
for (auto const & basePath : _allExcludes.keys()) const auto keys = _allExcludes.keys();
for (auto const & basePath : keys)
prepare(basePath); prepare(basePath);
} }

View file

@ -182,7 +182,8 @@ void NetworkSettings::saveProxySettings()
// start the sync. // start the sync.
FolderMan::instance()->setDirtyProxy(); FolderMan::instance()->setDirtyProxy();
for (auto account : AccountManager::instance()->accounts()) { const auto accounts = AccountManager::instance()->accounts();
for (auto account : accounts) {
account->freshConnectionAttempt(); account->freshConnectionAttempt();
} }
} }

View file

@ -145,7 +145,7 @@ void WebViewPageUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *reques
QUrl url = request->requestUrl(); QUrl url = request->requestUrl();
QString path = url.path(0).mid(1); // get undecoded path QString path = url.path(0).mid(1); // get undecoded path
QStringList parts = path.split("&"); const QStringList parts = path.split("&");
QString server; QString server;
QString user; QString user;

View file

@ -331,7 +331,7 @@ void SyncEngine::conflictRecordMaintenance()
// Remove stale conflict entries from the database // Remove stale conflict entries from the database
// by checking which files still exist and removing the // by checking which files still exist and removing the
// missing ones. // missing ones.
auto conflictRecordPaths = _journal->conflictRecordPaths(); const auto conflictRecordPaths = _journal->conflictRecordPaths();
for (const auto &path : conflictRecordPaths) { for (const auto &path : conflictRecordPaths) {
auto fsPath = _propagator->getFilePath(QString::fromUtf8(path)); auto fsPath = _propagator->getFilePath(QString::fromUtf8(path));
if (!QFileInfo(fsPath).exists()) { if (!QFileInfo(fsPath).exists()) {
@ -344,7 +344,7 @@ void SyncEngine::conflictRecordMaintenance()
// //
// This happens when the conflicts table is new or when conflict files // This happens when the conflicts table is new or when conflict files
// are downlaoded but the server doesn't send conflict headers. // 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)) if (!Utility::isConflictFile(path))
continue; continue;