Paste P283

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Dec 21 2018, 7:00 PM.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb59f89a..ba1e32c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Widgets
X11Extras
Svg
+ Test
Concurrent
)
diff --git a/applets/kicker/CMakeLists.txt b/applets/kicker/CMakeLists.txt
index 9551dcf2..1c5365f9 100644
--- a/applets/kicker/CMakeLists.txt
+++ b/applets/kicker/CMakeLists.txt
@@ -64,6 +64,7 @@ target_link_libraries(kickerplugin
Qt5::Qml
Qt5::Quick
Qt5::X11Extras
+ Qt5::Test
KF5::Activities
KF5::ActivitiesStats
KF5::ConfigCore
diff --git a/applets/kicker/plugin/abstractmodel.cpp b/applets/kicker/plugin/abstractmodel.cpp
index a4966d8d..3738cc58 100644
--- a/applets/kicker/plugin/abstractmodel.cpp
+++ b/applets/kicker/plugin/abstractmodel.cpp
@@ -20,10 +20,17 @@
#include "abstractmodel.h"
#include "actionlist.h"
+#include <QAbstractItemModelTester>
+#include <QTimer>
+
AbstractModel::AbstractModel(QObject *parent) : QAbstractListModel(parent)
, m_favoritesModel(nullptr)
, m_iconSize(32)
{
+ //deferred to not call virtuals from inside constuctor
+ QTimer::singleShot(0, this, [this]() {
+ new QAbstractItemModelTester(this, QAbstractItemModelTester::FailureReportingMode::Fatal, this);
+ });
}
AbstractModel::~AbstractModel()
diff --git a/applets/kicker/plugin/kastatsfavoritesmodel.cpp b/applets/kicker/plugin/kastatsfavoritesmodel.cpp
index 8740488c..dc53ff3c 100644
--- a/applets/kicker/plugin/kastatsfavoritesmodel.cpp
+++ b/applets/kicker/plugin/kastatsfavoritesmodel.cpp
@@ -39,6 +39,9 @@
#include <KActivities/Stats/ResultSet>
#include <KActivities/Stats/ResultWatcher>
+#include <QAbstractItemModelTester>
+#include <QTimer>
+
namespace KAStats = KActivities::Stats;
using namespace KAStats;
@@ -468,6 +471,12 @@ KAStatsFavoritesModel::KAStatsFavoritesModel(QObject *parent)
initForClient(clientId);
}
});
+
+
+ //deferred to not call virtuals from inside constuctor
+ QTimer::singleShot(0, this, [this]() {
+ new QAbstractItemModelTester(this, QAbstractItemModelTester::FailureReportingMode::Fatal, this);
+ });
}
KAStatsFavoritesModel::~KAStatsFavoritesModel()
diff --git a/applets/kicker/plugin/runnermodel.cpp b/applets/kicker/plugin/runnermodel.cpp
index cb0e762c..0a55bde3 100644
--- a/applets/kicker/plugin/runnermodel.cpp
+++ b/applets/kicker/plugin/runnermodel.cpp
@@ -27,6 +27,9 @@
#include <KRunner/AbstractRunner>
#include <KRunner/RunnerManager>
+#include <QAbstractItemModelTester>
+#include <QTimer>
+
RunnerModel::RunnerModel(QObject *parent) : QAbstractListModel(parent)
, m_favoritesModel(nullptr)
, m_appletInterface(nullptr)
@@ -36,6 +39,12 @@ RunnerModel::RunnerModel(QObject *parent) : QAbstractListModel(parent)
{
m_queryTimer.setSingleShot(true);
m_queryTimer.setInterval(10);
+
+ //deferred to not call virtuals from inside constuctor
+ QTimer::singleShot(0, this, [this]() {
+ new QAbstractItemModelTester(this, QAbstractItemModelTester::FailureReportingMode::Fatal, this);
+ });
+
connect(&m_queryTimer, SIGNAL(timeout()), this, SLOT(startQuery()));
}
davidedmundson edited the content of this paste. (Show Details)Dec 21 2018, 7:00 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.