summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-20 13:59:33 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-20 13:59:33 +0100
commit0d0e3271552dd99f227d64979ec9cf9cfed2e007 (patch)
tree6cab2d70fc912a387b46e9a0eda9e4bc3a249b8d
parente8b17abaa0abda47bc1bce81dd6efdfe85ff1af4 (diff)
downloadsink-0d0e3271552dd99f227d64979ec9cf9cfed2e007.tar.gz
sink-0d0e3271552dd99f227d64979ec9cf9cfed2e007.zip
The fallback on PATH was not implicit.
-rw-r--r--common/resourceaccess.cpp10
1 files changed, 9 insertions, 1 deletions
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<void> ResourceAccess::Private::initializeSocket()
219 args << resourceInstanceIdentifier << resourceName; 219 args << resourceInstanceIdentifier << resourceName;
220 220
221 //Prefer a binary next to this binary, otherwise fall-back to PATH. Necessary for MacOS bundles because the bundle is not in the PATH. 221 //Prefer a binary next to this binary, otherwise fall-back to PATH. Necessary for MacOS bundles because the bundle is not in the PATH.
222 auto executable = QStandardPaths::findExecutable("sink_synchronizer", {QCoreApplication::applicationDirPath()});
223 if (executable.isEmpty()) {
224 executable = QStandardPaths::findExecutable("sink_synchronizer");
225 }
226 if (executable.isEmpty()) {
227 SinkError() << "Failed to find the sink_synchronizer binary in the paths: " << QCoreApplication::applicationDirPath();
228 return KAsync::error("Failed to find the sink_synchronizer binary.");
229 }
222 qint64 pid = 0; 230 qint64 pid = 0;
223 if (QProcess::startDetached(QStandardPaths::findExecutable("sink_synchronizer", {QCoreApplication::applicationDirPath()}), args, QDir::homePath(), &pid)) { 231 if (QProcess::startDetached(executable, args, QDir::homePath(), &pid)) {
224 SinkTrace() << "Started resource " << pid; 232 SinkTrace() << "Started resource " << pid;
225 return tryToConnect() 233 return tryToConnect()
226 .onError([this, args](const KAsync::Error &error) { 234 .onError([this, args](const KAsync::Error &error) {