]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
Improve padding in the Places View
[dolphin.git] / src / main.cpp
index 9191127e527e8f20e8862b62b305b473952c62d7..d557f2ea034c827b95af51b6efb2271c71ef26a8 100644 (file)
@@ -26,6 +26,7 @@
 #include <QDBusInterface>
 #include <QDBusAbstractInterface>
 #include <QDBusConnectionInterface>
 #include <QDBusInterface>
 #include <QDBusAbstractInterface>
 #include <QDBusConnectionInterface>
+#include <QSessionManager>
 
 #ifndef Q_OS_WIN
 #include <unistd.h>
 
 #ifndef Q_OS_WIN
 #include <unistd.h>
@@ -132,6 +133,14 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 
 
     if (parser.isSet(QStringLiteral("daemon"))) {
 
 
     if (parser.isSet(QStringLiteral("daemon"))) {
+        // Disable session management for the daemonized version
+        // See https://bugs.kde.org/show_bug.cgi?id=417219
+        auto disableSessionManagement = [](QSessionManager &sm) {
+            sm.setRestartHint(QSessionManager::RestartNever);
+        };
+        QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
+        QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
+
         KDBusService dolphinDBusService;
         DBusInterface interface;
         interface.setAsDaemon();
         KDBusService dolphinDBusService;
         DBusInterface interface;
         interface.setAsDaemon();