Changeset View
Changeset View
Standalone View
Standalone View
autotests/libs/testrunner/setup.cpp
Show All 16 Lines | |||||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "setup.h" | 19 | #include "setup.h" | ||
20 | #include "config.h" //krazy:exclude=includes | 20 | #include "config.h" //krazy:exclude=includes | ||
21 | 21 | | |||
22 | #include <agentinstance.h> | 22 | #include <agentinstance.h> | ||
23 | #include <agentinstancecreatejob.h> | 23 | #include <agentinstancecreatejob.h> | ||
24 | #include <resourcesynchronizationjob.h> | 24 | #include <resourcesynchronizationjob.h> | ||
25 | #include <private/standarddirs_p.h> | ||||
25 | 26 | | |||
26 | #include <KConfig> | 27 | #include <KConfig> | ||
27 | #include <kconfiggroup.h> | 28 | #include <kconfiggroup.h> | ||
28 | #include <qdebug.h> | 29 | #include <qdebug.h> | ||
29 | #include <KProcess> | 30 | #include <KProcess> | ||
30 | 31 | | |||
31 | #include <QCoreApplication> | 32 | #include <QCoreApplication> | ||
32 | #include <QDir> | 33 | #include <QDir> | ||
33 | #include <QFile> | 34 | #include <QFile> | ||
34 | #include <QTimer> | 35 | #include <QTimer> | ||
35 | #include <QDBusConnection> | 36 | #include <QDBusConnection> | ||
36 | #include <QSettings> | 37 | #include <QSettings> | ||
37 | 38 | | |||
38 | bool SetupTest::startAkonadiDaemon() | 39 | bool SetupTest::startAkonadiDaemon() | ||
39 | { | 40 | { | ||
40 | Q_ASSERT(Akonadi::ServerManager::hasInstanceIdentifier()); | 41 | Q_ASSERT(Akonadi::ServerManager::hasInstanceIdentifier()); | ||
41 | 42 | | |||
42 | if (!mAkonadiDaemonProcess) { | 43 | if (!mAkonadiDaemonProcess) { | ||
43 | mAkonadiDaemonProcess = new KProcess(this); | 44 | mAkonadiDaemonProcess = new KProcess(this); | ||
44 | connect(mAkonadiDaemonProcess, QOverload<int>::of(&KProcess::finished), | 45 | connect(mAkonadiDaemonProcess, QOverload<int>::of(&KProcess::finished), | ||
45 | this, &SetupTest::slotAkonadiDaemonProcessFinished); | 46 | this, &SetupTest::slotAkonadiDaemonProcessFinished); | ||
46 | } | 47 | } | ||
47 | 48 | | |||
48 | mAkonadiDaemonProcess->setProgram(QStringLiteral("akonadi_control"), | 49 | mAkonadiDaemonProcess->setProgram(Akonadi::StandardDirs::findExecutable(QStringLiteral("akonadi_control")), | ||
49 | { QStringLiteral("--instance"), instanceId() }); | 50 | { QStringLiteral("--instance"), instanceId() }); | ||
50 | mAkonadiDaemonProcess->start(); | 51 | mAkonadiDaemonProcess->start(); | ||
51 | const bool started = mAkonadiDaemonProcess->waitForStarted(5000); | 52 | const bool started = mAkonadiDaemonProcess->waitForStarted(5000); | ||
52 | qDebug() << "Started akonadi daemon with pid:" << mAkonadiDaemonProcess->pid(); | 53 | qDebug() << "Started akonadi daemon with pid:" << mAkonadiDaemonProcess->pid(); | ||
53 | return started; | 54 | return started; | ||
54 | } | 55 | } | ||
55 | 56 | | |||
56 | void SetupTest::stopAkonadiDaemon() | 57 | void SetupTest::stopAkonadiDaemon() | ||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |