Commit 342e572d authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎱 Committed by Albert Vaca Cintora

reliably close daemon and indicator when quitting on Windows and MacOS

parent 5fd0d232
Pipeline #7757 passed with stage
in 17 minutes and 8 seconds
......@@ -60,7 +60,7 @@ int main(int argc, char** argv)
#ifdef Q_OS_MAC
// Unset launchctl env, avoid block
DBusHelper::macosUnsetLaunchctlEnv();
// Start kdeconnectd
QProcess kdeconnectdProcess;
if (QFile::exists(QCoreApplication::applicationDirPath() + QStringLiteral("/kdeconnectd"))) {
......@@ -151,8 +151,12 @@ int main(int argc, char** argv)
QStringLiteral("/MainApplication"),
QStringLiteral("org.qtproject.Qt.QCoreApplication"),
QStringLiteral("quit"));
DBusHelper::sessionBus().call(message);
QCoreApplication::quit(); // Close this application
DBusHelper::sessionBus().call(message, QDBus::NoBlock); // Close our daemon
message = QDBusMessage::createMethodCall(qApp->applicationName(),
QStringLiteral("/MainApplication"),
QStringLiteral("org.qtproject.Qt.QCoreApplication"),
QStringLiteral("quit"));
DBusHelper::sessionBus().call(message, QDBus::NoBlock); // Close our indicator
});
#endif
};
......
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