From 16de0150ce184c56ff521b5517176ef033dcbd37 Mon Sep 17 00:00:00 2001 From: Weixuan Xiao Date: Mon, 19 Aug 2019 05:39:05 +0000 Subject: [PATCH] Fix sms indicator entry for macOS --- indicator/deviceindicator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indicator/deviceindicator.cpp b/indicator/deviceindicator.cpp index 20cf22927..32170541f 100644 --- a/indicator/deviceindicator.cpp +++ b/indicator/deviceindicator.cpp @@ -113,11 +113,12 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device) setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_share")), [sendFile](bool available) { sendFile->setVisible(available); }, this); - - if (!QStandardPaths::findExecutable(QStringLiteral("kdeconnect-sms")).isEmpty()) { + // Search current application path + const QString kdeconnectsmsExecutable = QStandardPaths::findExecutable(QStringLiteral("kdeconnect-sms"), { QCoreApplication::applicationDirPath() }); + if (!kdeconnectsmsExecutable.isEmpty()) { auto smsapp = addAction(QIcon::fromTheme(QStringLiteral("message-new")), i18n("SMS Messages...")); - QObject::connect(smsapp, &QAction::triggered, device, [device] () { - QProcess::startDetached(QLatin1String("kdeconnect-sms"), { QStringLiteral("--device"), device->id() }); + QObject::connect(smsapp, &QAction::triggered, device, [device, kdeconnectsmsExecutable] () { + QProcess::startDetached(kdeconnectsmsExecutable, { QStringLiteral("--device"), device->id() }); }); setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_sms")), [smsapp](bool available) { smsapp->setVisible(available); }, this); }