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
This commit is contained in:
Méven Car 2019-03-22 10:36:29 +01:00
parent af8c491904
commit 6dbabdfee6

View file

@ -185,7 +185,8 @@ void InformationPanel::showContextMenu(const QPoint &pos) {
dateformatAction->setChecked(InformationPanelSettings::dateFormat() == static_cast<int>(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