mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Disable session management for daemon
We don't need to autostart the daemon if it was running at logout. BUG: 417219 FIXED-IN: 20.12
This commit is contained in:
parent
129570b131
commit
bf11c835eb
|
@ -26,6 +26,7 @@
|
|||
#include <QDBusInterface>
|
||||
#include <QDBusAbstractInterface>
|
||||
#include <QDBusConnectionInterface>
|
||||
#include <QSessionManager>
|
||||
|
||||
#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"))) {
|
||||
// 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();
|
||||
|
|
Loading…
Reference in a new issue