reliably close daemon and indicator when quitting on Windows and MacOS
This commit is contained in:
parent
5fd0d2327b
commit
342e572d90
1 changed files with 7 additions and 3 deletions
|
@ -60,7 +60,7 @@ int main(int argc, char** argv)
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
// Unset launchctl env, avoid block
|
// Unset launchctl env, avoid block
|
||||||
DBusHelper::macosUnsetLaunchctlEnv();
|
DBusHelper::macosUnsetLaunchctlEnv();
|
||||||
|
|
||||||
// Start kdeconnectd
|
// Start kdeconnectd
|
||||||
QProcess kdeconnectdProcess;
|
QProcess kdeconnectdProcess;
|
||||||
if (QFile::exists(QCoreApplication::applicationDirPath() + QStringLiteral("/kdeconnectd"))) {
|
if (QFile::exists(QCoreApplication::applicationDirPath() + QStringLiteral("/kdeconnectd"))) {
|
||||||
|
@ -151,8 +151,12 @@ int main(int argc, char** argv)
|
||||||
QStringLiteral("/MainApplication"),
|
QStringLiteral("/MainApplication"),
|
||||||
QStringLiteral("org.qtproject.Qt.QCoreApplication"),
|
QStringLiteral("org.qtproject.Qt.QCoreApplication"),
|
||||||
QStringLiteral("quit"));
|
QStringLiteral("quit"));
|
||||||
DBusHelper::sessionBus().call(message);
|
DBusHelper::sessionBus().call(message, QDBus::NoBlock); // Close our daemon
|
||||||
QCoreApplication::quit(); // Close this application
|
message = QDBusMessage::createMethodCall(qApp->applicationName(),
|
||||||
|
QStringLiteral("/MainApplication"),
|
||||||
|
QStringLiteral("org.qtproject.Qt.QCoreApplication"),
|
||||||
|
QStringLiteral("quit"));
|
||||||
|
DBusHelper::sessionBus().call(message, QDBus::NoBlock); // Close our indicator
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue