]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistselectionmanager.cpp
Compile without foreach
[dolphin.git] / src / kitemviews / kitemlistselectionmanager.cpp
index 6bee19414ce1b7736d2a9d380287cc532837919c..e5f450a7c594408f41d07de76dae5e1ea39bb485 100644 (file)
@@ -1,24 +1,11 @@
-/***************************************************************************
- *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
- *   Copyright (C) 2011 by Frank Reininghaus <frank78ac@googlemail.com>    *
- *                                                                         *
- *   Based on the Itemviews NG project from Trolltech Labs                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
+ * SPDX-FileCopyrightText: 2011 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ * Based on the Itemviews NG project from Trolltech Labs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "kitemlistselectionmanager.h"
 
@@ -235,7 +222,7 @@ void KItemListSelectionManager::itemsInserted(const KItemRangeList& itemRanges)
     } else {
         const int previousCurrent = m_currentItem;
         int inc = 0;
-        foreach (const KItemRange& itemRange, itemRanges) {
+        for (const KItemRange& itemRange : itemRanges) {
             if (m_currentItem < itemRange.index) {
                 break;
             }
@@ -255,7 +242,7 @@ void KItemListSelectionManager::itemsInserted(const KItemRangeList& itemRanges)
         m_anchorItem = 0;
     } else {
         int inc = 0;
-        foreach (const KItemRange& itemRange, itemRanges) {
+        for (const KItemRange& itemRange : itemRanges) {
             if (m_anchorItem < itemRange.index) {
                 break;
             }
@@ -271,7 +258,7 @@ void KItemListSelectionManager::itemsInserted(const KItemRangeList& itemRanges)
 
         for (int index: previous) {
             int inc = 0;
-            foreach (const KItemRange& itemRange, itemRanges) {
+            for (const KItemRange& itemRange : itemRanges) {
                 if (index < itemRange.index) {
                     break;
                 }
@@ -389,7 +376,7 @@ int KItemListSelectionManager::indexAfterRangesRemoving(int index, const KItemRa
                                                         const RangesRemovingBehaviour behaviour) const
 {
     int dec = 0;
-    foreach (const KItemRange& itemRange, itemRanges) {
+    for (const KItemRange& itemRange : itemRanges) {
         if (index < itemRange.index) {
             break;
         }