X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5bde333ca7e9c285f1101bac0434fb4e60b6d4d5..f65b0899c3666561cafac14f67ab0bb8a5bfa00a:/src/tests/kfileitemmodelbenchmark.cpp diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp index 41dcce019..5c44a354f 100644 --- a/src/tests/kfileitemmodelbenchmark.cpp +++ b/src/tests/kfileitemmodelbenchmark.cpp @@ -1,37 +1,21 @@ -/*************************************************************************** - * Copyright (C) 2011 by Peter Penz * - * 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: 2011 Peter Penz + * SPDX-FileCopyrightText: 2013 Frank Reininghaus + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include #include -#include #include #include "kitemviews/kfileitemmodel.h" #include "kitemviews/private/kfileitemmodelsortalgorithm.h" -#include "testdir.h" - void myMessageOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg) { - Q_UNUSED(context); + Q_UNUSED(context) switch (type) { case QtDebugMsg: @@ -59,7 +43,7 @@ class KFileItemModelBenchmark : public QObject public: KFileItemModelBenchmark(); -private slots: +private Q_SLOTS: void insertAndRemoveManyItems_data(); void insertAndRemoveManyItems(); @@ -83,7 +67,7 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems_data() QList sizes; sizes << 100000; - foreach (int n, sizes) { + for (int n : qAsConst(sizes)) { QStringList allStrings; for (int i = 0; i < n; ++i) { allStrings << QString::number(i); @@ -167,8 +151,8 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems() model.m_naturalSorting = false; model.setRoles({"text"}); - QSignalSpy spyItemsInserted(&model, SIGNAL(itemsInserted(KItemRangeList))); - QSignalSpy spyItemsRemoved(&model, SIGNAL(itemsRemoved(KItemRangeList))); + QSignalSpy spyItemsInserted(&model, &KFileItemModel::itemsInserted); + QSignalSpy spyItemsRemoved(&model, &KFileItemModel::itemsRemoved); QBENCHMARK { model.slotClear(); @@ -213,7 +197,7 @@ KFileItemList KFileItemModelBenchmark::createFileItemList(const QStringList& fil qInstallMessageHandler(myMessageOutput); KFileItemList result; - foreach (const QString& name, fileNames) { + for (const QString& name : fileNames) { const KFileItem item(QUrl::fromLocalFile(prefix + name), QString(), KFileItem::Unknown); result << item; }