Commit 16de0150 authored by Weixuan Xiao's avatar Weixuan Xiao

Fix sms indicator entry for macOS

parent 5b13f289
Pipeline #6820 passed with stage
in 7 minutes and 25 seconds
......@@ -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);
}
......
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