X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/da83e8cbdb0354f359bdf08d610693665989c9f1..d2f044b32d34023fbf4755b95dcafe71ed00b55f:/src/tests/kitemsettest.cpp diff --git a/src/tests/kitemsettest.cpp b/src/tests/kitemsettest.cpp index ca2c16b27..d19752c33 100644 --- a/src/tests/kitemsettest.cpp +++ b/src/tests/kitemsettest.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2013 by Frank Reininghaus * - * * - * 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 + * + * 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 KItemRangeList2QSet(const KItemRangeList& itemRanges) { QSet 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 KItemRangeList2QSet(const KItemRangeList& itemRanges) QVector KItemRangeList2QVector(const KItemRangeList& itemRanges) { QVector 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 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)); }