]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kfileitemmodelbenchmark.cpp
Dolphin: Implement package kit for deb/rpm/pacman service packages
[dolphin.git] / src / tests / kfileitemmodelbenchmark.cpp
index 3ff0405fdc187b923ca9b7ee7a7ac352029fba9f..8dfb4f622f8a0a52b1a52caaf650f98d661ff24a 100644 (file)
 #include <QTest>
 #include <QSignalSpy>
 
-#include <algorithm>
 #include <random>
 
 #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:
@@ -81,8 +78,7 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
     QTest::addColumn<KItemRangeList>("expectedItemsRemoved");
 
     QList<int> sizes;
-    sizes << 1000 << 4000 << 16000 << 64000 << 256000;
-    //sizes << 50000 << 100000 << 150000 << 200000 << 250000;
+    sizes << 100000;
 
     foreach (int n, sizes) {
         QStringList allStrings;
@@ -168,8 +164,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();