]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kitemsettest.cpp
Build with QT_NO_KEYWORDS
[dolphin.git] / src / tests / kitemsettest.cpp
index ca2c16b27ba2070ada88efcbbc59e6e0c698431d..9b40e150dc1d81cc07607ab7dc101832187e74d2 100644 (file)
@@ -1,21 +1,8 @@
-/***************************************************************************
- *   Copyright (C) 2013 by Frank Reininghaus <frank78ac@googlemail.com>    *
- *                                                                         *
- *   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: 2013 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "kitemviews/kitemset.h"
 
@@ -29,7 +16,7 @@ Q_DECLARE_METATYPE(KItemRangeList)
 KItemSet KItemRangeList2KItemSet(const KItemRangeList& itemRanges)
 {
     KItemSet result;
-    foreach (const KItemRange& range, itemRanges) {
+    for (const KItemRange& range : itemRanges) {
         for (int i = range.index; i < range.index + range.count; ++i) {
             result.insert(i);
         }
@@ -43,7 +30,7 @@ KItemSet KItemRangeList2KItemSet(const KItemRangeList& itemRanges)
 QSet<int> KItemRangeList2QSet(const KItemRangeList& itemRanges)
 {
     QSet<int> result;
-    foreach (const KItemRange& range, itemRanges) {
+    for (const KItemRange& range : itemRanges) {
         for (int i = range.index; i < range.index + range.count; ++i) {
             result.insert(i);
         }
@@ -57,7 +44,7 @@ QSet<int> KItemRangeList2QSet(const KItemRangeList& itemRanges)
 QVector<int> KItemRangeList2QVector(const KItemRangeList& itemRanges)
 {
     QVector<int> result;
-    foreach (const KItemRange& range, itemRanges) {
+    for (const KItemRange& range : itemRanges) {
         for (int i = range.index; i < range.index + range.count; ++i) {
             result.append(i);
         }
@@ -78,11 +65,11 @@ static QSet<int> KItemSet2QSet(const KItemSet& itemSet)
     // Check that the conversion was successful.
     Q_ASSERT(itemSet.count() == result.count());
 
-    for (int i : itemSet) {
+    for (int i : qAsConst(itemSet)) {
         Q_ASSERT(result.contains(i));
     }
 
-    foreach (int i, result) {
+    for (int i : qAsConst(result)) {
         Q_ASSERT(itemSet.contains(i));
     }
 
@@ -97,7 +84,7 @@ class KItemSetTest : public QObject
 {
     Q_OBJECT
 
-private slots:
+private Q_SLOTS:
     void initTestCase();
 
     void testConstruction_data();