From 8da22b90ab4857167affa1da270e68ab9c2281f9 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 2 Jun 2019 14:01:42 +0000 Subject: [PATCH] Disable session management --- daemon/kdeconnectd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index c5ea772db..62887097e 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -128,6 +129,13 @@ int main(int argc, char* argv[]) DesktopDaemon daemon; + // kdeconnectd is autostarted, so disable session management to speed up startup + auto disableSessionManagement = [](QSessionManager &sm) { + sm.setRestartHint(QSessionManager::RestartNever); + }; + QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); + QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); + return app.exec(); }