From 4715f63580f64d7baaba072f6c69632ccaa8a187 Mon Sep 17 00:00:00 2001 From: Aleksey Lysenko Date: Wed, 16 Jun 2021 11:38:18 +0200 Subject: Remove possible qt containers detach (#8727) * Replaced obsolete foreach-loops with for-loops * Added a copy of queries into SqlDatabase::close * Used const reference to avoid unneeded copying * Fixed Qt containers possible detach within for-loop * Removed unneeded copies before for-loops --- src/gui/folder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/folder.cpp') diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 63ab748b6..b5f8b5cfe 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -504,7 +504,7 @@ int Folder::slotDiscardDownloadProgress() QSet keep_nothing; const QVector deleted_infos = _journal.getAndDeleteStaleDownloadInfos(keep_nothing); - foreach (const SyncJournalDb::DownloadInfo &deleted_info, deleted_infos) { + for (const auto &deleted_info : deleted_infos) { const QString tmppath = folderpath.filePath(deleted_info._tmpfile); qCInfo(lcFolder) << "Deleting temporary file: " << tmppath; FileSystem::remove(tmppath); @@ -673,7 +673,7 @@ void Folder::saveToSettings() const // True if the folder path appears in only one account bool oneAccountOnly = true; - foreach (Folder *other, FolderMan::instance()->map()) { + for (auto *other : FolderMan::instance()->map()) { if (other != this && other->cleanPath() == this->cleanPath()) { oneAccountOnly = false; break; -- cgit v1.2.3