diff options
author | Aleksey Lysenko <lysenkoalexmail@gmail.com> | 2021-06-16 12:38:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 12:38:18 +0300 |
commit | 4715f63580f64d7baaba072f6c69632ccaa8a187 (patch) | |
tree | 201f42256d996e8aad25a70e929821d85e85011c /src/gui/folder.cpp | |
parent | 09b538f4887d77685983dcb71d1ef6c1075a1b49 (diff) |
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
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r-- | src/gui/folder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<QString> keep_nothing; const QVector<SyncJournalDb::DownloadInfo> 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; |