diff options
| author | Alexander Lohnau <[email protected]> | 2020-10-23 19:48:22 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-10-23 18:23:06 +0000 |
| commit | a24327cd50ef17b953ecb908d260b73460158107 (patch) | |
| tree | b0fdaf2b2ab6cc4df0d471b3f1e9f449be71aa33 /src/dolphinmainwindow.cpp | |
| parent | 360a8dd883f7e281c0a3f2ae729450790399bf3d (diff) | |
Compile without foreach
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index f7ec5f511..e45ca5e38 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -427,7 +427,7 @@ void DolphinMainWindow::openInNewTab() const KFileItemList& list = m_activeViewContainer->view()->selectedItems(); bool tabCreated = false; - foreach (const KFileItem& item, list) { + for (const KFileItem& item : list) { const QUrl& url = DolphinView::openItemAsFolderUrl(item); if (!url.isEmpty()) { openNewTabAfterCurrentTab(url); @@ -861,7 +861,8 @@ void DolphinMainWindow::replaceLocation() void DolphinMainWindow::togglePanelLockState() { const bool newLockState = !GeneralSettings::lockPanels(); - foreach (QObject* child, children()) { + const auto childrenObjects = children(); + for (QObject* child : childrenObjects) { DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child); if (dock) { dock->setLocked(newLockState); @@ -2083,7 +2084,8 @@ bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu) Q_ASSERT(menu); const KToolBar* toolBarWidget = toolBar(); - foreach (const QWidget* widget, action->associatedWidgets()) { + const auto associatedWidgets = action->associatedWidgets(); + for (const QWidget* widget : associatedWidgets) { if (widget == toolBarWidget) { return false; } |
