From 095560f0bece64eab396376845567d71781484b8 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 82fa02e7d..d5e02ba2c 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -116,6 +117,13 @@ int main(int argc, char* argv[]) Daemon* daemon = new DesktopDaemon; QObject::connect(daemon, SIGNAL(destroyed(QObject*)), &app, SLOT(quit())); + // 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(); }