]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemset.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / kitemviews / kitemset.cpp
index e36829eb5c532ba72c7e1d5c068811c2d10d6e21..c8c1ff076ccc5edf503ab7ebc5b846ea661e1d81 100644 (file)
@@ -1,25 +1,11 @@
-/***************************************************************************
- *   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 "kitemset.h"
 
-
 KItemSet::iterator KItemSet::insert(int i)
 {
     if (m_itemRanges.empty()) {
@@ -141,7 +127,7 @@ KItemSet::iterator KItemSet::erase(iterator it)
     }
 }
 
-KItemSet KItemSet::operator+(const KItemSetother) const
+KItemSet KItemSet::operator+(const KItemSet &other) const
 {
     KItemSet sum;
 
@@ -183,8 +169,7 @@ KItemSet KItemSet::operator+(const KItemSet& other) const
                     count = qMax(count, it2->index + it2->count - index);
                     ++it2;
                 }
-            } while ((it1 != end1 && it1->index <= index + count)
-                    || (it2 != end2 && it2->index <= index + count));
+            } while ((it1 != end1 && it1->index <= index + count) || (it2 != end2 && it2->index <= index + count));
 
             sum.m_itemRanges.append(KItemRange(index, count));
         }
@@ -193,7 +178,7 @@ KItemSet KItemSet::operator+(const KItemSet& other) const
     return sum;
 }
 
-KItemSet KItemSet::operator^(const KItemSetother) const
+KItemSet KItemSet::operator^(const KItemSet &other) const
 {
     // We are looking for all ints which are either in *this or in other,
     // but not in both.
@@ -210,14 +195,14 @@ KItemSet KItemSet::operator^(const KItemSet& other) const
     const QVector<int>::iterator end = rangeBoundaries.end();
     QVector<int>::iterator it = begin;
 
-    foreach (const KItemRange& range, m_itemRanges) {
+    for (const KItemRange &range : std::as_const(m_itemRanges)) {
         *it++ = range.index;
         *it++ = range.index + range.count;
     }
 
     const QVector<int>::iterator middle = it;
 
-    foreach (const KItemRange& range, other.m_itemRanges) {
+    for (const KItemRange &range : std::as_const(other.m_itemRanges)) {
         *it++ = range.index;
         *it++ = range.index + range.count;
     }