We don't need to autostart the daemon if it was running at logout.
BUG: 417219
FIXED-IN: 20.12
#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>
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();