From 0d0e3271552dd99f227d64979ec9cf9cfed2e007 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 20 Mar 2018 13:59:33 +0100 Subject: The fallback on PATH was not implicit. --- common/resourceaccess.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 40e403c..4903a79 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp @@ -219,8 +219,16 @@ KAsync::Job ResourceAccess::Private::initializeSocket() args << resourceInstanceIdentifier << resourceName; //Prefer a binary next to this binary, otherwise fall-back to PATH. Necessary for MacOS bundles because the bundle is not in the PATH. + auto executable = QStandardPaths::findExecutable("sink_synchronizer", {QCoreApplication::applicationDirPath()}); + if (executable.isEmpty()) { + executable = QStandardPaths::findExecutable("sink_synchronizer"); + } + if (executable.isEmpty()) { + SinkError() << "Failed to find the sink_synchronizer binary in the paths: " << QCoreApplication::applicationDirPath(); + return KAsync::error("Failed to find the sink_synchronizer binary."); + } qint64 pid = 0; - if (QProcess::startDetached(QStandardPaths::findExecutable("sink_synchronizer", {QCoreApplication::applicationDirPath()}), args, QDir::homePath(), &pid)) { + if (QProcess::startDetached(executable, args, QDir::homePath(), &pid)) { SinkTrace() << "Started resource " << pid; return tryToConnect() .onError([this, args](const KAsync::Error &error) { -- cgit v1.2.3