Commit 843ac53f authored by David Faure's avatar David Faure

Akonadi: prefer binaries from the same directory

Summary:
This allows to test changes to akonadiserver without installing it
(given that all binaries are in build/bin)

Test Plan: my debug output in akonadiserver now shows up, running a test program from the builddir.

Reviewers: dvratil, vkrause

Reviewed By: dvratil

Subscribers: kde-pim

Differential Revision: https://phabricator.kde.org/D19404
parent 37f1871f
......@@ -11,6 +11,7 @@ set(akonaditest_SRCS
add_executable(akonaditest ${akonaditest_SRCS})
target_link_libraries(akonaditest
KF5::AkonadiPrivate
KF5::AkonadiCore
KF5::I18n
KF5::ConfigCore
......
......@@ -22,6 +22,7 @@
#include <agentinstance.h>
#include <agentinstancecreatejob.h>
#include <resourcesynchronizationjob.h>
#include <private/standarddirs_p.h>
#include <KConfig>
#include <kconfiggroup.h>
......@@ -45,7 +46,7 @@ bool SetupTest::startAkonadiDaemon()
this, &SetupTest::slotAkonadiDaemonProcessFinished);
}
mAkonadiDaemonProcess->setProgram(QStringLiteral("akonadi_control"),
mAkonadiDaemonProcess->setProgram(Akonadi::StandardDirs::findExecutable(QStringLiteral("akonadi_control")),
{ QStringLiteral("--instance"), instanceId() });
mAkonadiDaemonProcess->start();
const bool started = mAkonadiDaemonProcess->waitForStarted(5000);
......
......@@ -23,6 +23,7 @@
#include <shared/akapplication.h>
#include <private/instance_p.h>
#include <private/standarddirs_p.h>
#include <QTimer>
......@@ -171,6 +172,9 @@ static bool listContains(const QStringList &list, const QString &pattern)
void ProcessControl::start()
{
// Prefer akonadiserver from the builddir
mApplication = StandardDirs::findExecutable(mApplication);
#ifdef Q_OS_UNIX
QString agentValgrind = akGetEnv("AKONADI_VALGRIND");
if (!agentValgrind.isEmpty() && (mApplication.contains(agentValgrind) || listContains(mArguments, agentValgrind))) {
......
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