Fix sms indicator entry for macOS
This commit is contained in:
parent
5b13f28912
commit
16de0150ce
1 changed files with 5 additions and 4 deletions
|
@ -113,11 +113,12 @@ DeviceIndicator::DeviceIndicator(DeviceDbusInterface* device)
|
||||||
|
|
||||||
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_share")), [sendFile](bool available) { sendFile->setVisible(available); }, this);
|
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_share")), [sendFile](bool available) { sendFile->setVisible(available); }, this);
|
||||||
|
|
||||||
|
// Search current application path
|
||||||
if (!QStandardPaths::findExecutable(QStringLiteral("kdeconnect-sms")).isEmpty()) {
|
const QString kdeconnectsmsExecutable = QStandardPaths::findExecutable(QStringLiteral("kdeconnect-sms"), { QCoreApplication::applicationDirPath() });
|
||||||
|
if (!kdeconnectsmsExecutable.isEmpty()) {
|
||||||
auto smsapp = addAction(QIcon::fromTheme(QStringLiteral("message-new")), i18n("SMS Messages..."));
|
auto smsapp = addAction(QIcon::fromTheme(QStringLiteral("message-new")), i18n("SMS Messages..."));
|
||||||
QObject::connect(smsapp, &QAction::triggered, device, [device] () {
|
QObject::connect(smsapp, &QAction::triggered, device, [device, kdeconnectsmsExecutable] () {
|
||||||
QProcess::startDetached(QLatin1String("kdeconnect-sms"), { QStringLiteral("--device"), device->id() });
|
QProcess::startDetached(kdeconnectsmsExecutable, { QStringLiteral("--device"), device->id() });
|
||||||
});
|
});
|
||||||
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_sms")), [smsapp](bool available) { smsapp->setVisible(available); }, this);
|
setWhenAvailable(device->hasPlugin(QStringLiteral("kdeconnect_sms")), [smsapp](bool available) { smsapp->setVisible(available); }, this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue