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/settingsdialog.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/settingsdialog.cpp')
-rw-r--r-- | src/gui/settingsdialog.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 4402d9576..d09790c97 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -227,7 +227,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) this, &SettingsDialog::accountAdded); connect(AccountManager::instance(), &AccountManager::accountRemoved, this, &SettingsDialog::accountRemoved); - foreach (auto ai, AccountManager::instance()->accounts()) { + for (const auto &ai : AccountManager::instance()->accounts()) { accountAdded(ai.data()); } @@ -441,7 +441,8 @@ void SettingsDialog::customizeStyle() QString background(palette().base().color().name()); _ui->toolBar->setStyleSheet(TOOLBAR_CSS().arg(background, dark, highlightColor, highlightTextColor)); - for (auto a : findChildren<ToolButtonAction *>()) { + const auto &toolButtonActions = findChildren<ToolButtonAction *>(); + for (auto *a : toolButtonActions) { a->updateIcon(); } } |