From 6dbabdfee65083bd074d931643dc792cac03e675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Fri, 22 Mar 2019 10:36:29 +0100 Subject: [PATCH] Convert foreach to for loops Test Plan: Compile Reviewers: #dolphin, elvisangelaccio, ngraham Reviewed By: #dolphin, elvisangelaccio, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19911 --- src/panels/information/informationpanel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index a864cb0057..2b6fff158f 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -185,7 +185,8 @@ void InformationPanel::showContextMenu(const QPoint &pos) { dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast(Baloo::DateFormats::ShortFormat)); popup.addSeparator(); - foreach (QAction* action, customContextMenuActions()) { + const auto actions = customContextMenuActions(); + for (QAction *action : actions) { popup.addAction(action); } @@ -311,7 +312,7 @@ void InformationPanel::slotFilesAdded(const QString& directory) void InformationPanel::slotFilesChanged(const QStringList& files) { - foreach (const QString& fileName, files) { + for (const QString& fileName : files) { if (m_shownUrl == QUrl::fromLocalFile(fileName)) { showItemInfo(); break; @@ -321,7 +322,7 @@ void InformationPanel::slotFilesChanged(const QStringList& files) void InformationPanel::slotFilesRemoved(const QStringList& files) { - foreach (const QString& fileName, files) { + for (const QString& fileName : files) { if (m_shownUrl == QUrl::fromLocalFile(fileName)) { // the currently shown item has been removed, show // the parent directory as fallback