Commit e2f9f14b authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Prevent ViewerPluginCreate*Tests from starting Akonadi

The tests accidentally started Akonadi because the tested class
instantiates EventEdit (or Todo/NoteEdit) class, which internally
instantiates CollectionComboBox, which then starts Akonadi. This
can be workaround by passing setting the MessageViewer::_k_fooEditStubModel,
which prevents the CollectionComboBox from using Akonadi models.
parent 39124d8f
......@@ -20,12 +20,20 @@
#include <KActionCollection>
#include <QBoxLayout>
#include <QTest>
#include <QStandardItemModel>
#include <messageviewer/viewerplugininterface.h>
namespace MessageViewer
{
extern MESSAGEVIEWER_EXPORT QAbstractItemModel *_k_eventEditStubModel;
}
ViewerPluginCreateeventTest::ViewerPluginCreateeventTest(QObject *parent)
: QObject(parent)
{
QStandardItemModel *model = new QStandardItemModel;
MessageViewer::_k_eventEditStubModel = model;
}
ViewerPluginCreateeventTest::~ViewerPluginCreateeventTest()
......
......@@ -20,12 +20,19 @@
#include <KActionCollection>
#include <QHBoxLayout>
#include <QTest>
#include <QStandardItemModel>
#include <messageviewer/viewerplugininterface.h>
namespace MessageViewer
{
extern MESSAGEVIEWER_EXPORT QAbstractItemModel *_k_noteEditStubModel;
}
ViewerPluginCreateNoteTest::ViewerPluginCreateNoteTest(QObject *parent)
: QObject(parent)
{
QStandardItemModel *model = new QStandardItemModel;
MessageViewer::_k_noteEditStubModel = model;
}
ViewerPluginCreateNoteTest::~ViewerPluginCreateNoteTest()
......
......@@ -20,11 +20,19 @@
#include <QTest>
#include <KActionCollection>
#include <QHBoxLayout>
#include <QStandardItemModel>
#include <messageviewer/viewerplugininterface.h>
namespace MessageViewer
{
extern MESSAGEVIEWER_EXPORT QAbstractItemModel *_k_todoEditStubModel;
}
ViewerPluginCreateTodoTest::ViewerPluginCreateTodoTest(QObject *parent)
: QObject(parent)
{
QStandardItemModel *model = new QStandardItemModel;
MessageViewer::_k_todoEditStubModel = model;
}
ViewerPluginCreateTodoTest::~ViewerPluginCreateTodoTest()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment