diff options
-rw-r--r-- | common/resourceaccess.cpp | 10 |
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) { |