Changeset View
Changeset View
Standalone View
Standalone View
kuiserver/main.cpp
Show All 24 Lines | |||||
25 | #include "uiserver_p.h" | 25 | #include "uiserver_p.h" | ||
26 | #include "progresslistmodel.h" | 26 | #include "progresslistmodel.h" | ||
27 | 27 | | |||
28 | #include <kdbusservice.h> | 28 | #include <kdbusservice.h> | ||
29 | 29 | | |||
30 | #include <kworkspace.h> | 30 | #include <kworkspace.h> | ||
31 | 31 | | |||
32 | #include <QCommandLineParser> | 32 | #include <QCommandLineParser> | ||
33 | #include <QSessionManager> | ||||
33 | 34 | | |||
34 | Q_LOGGING_CATEGORY(KUISERVER, "kuiserver", QtInfoMsg) | 35 | Q_LOGGING_CATEGORY(KUISERVER, "kuiserver", QtInfoMsg) | ||
35 | 36 | | |||
36 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) | 37 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) | ||
37 | { | 38 | { | ||
38 | KWorkSpace::detectPlatform(argc, argv); | 39 | KWorkSpace::detectPlatform(argc, argv); | ||
39 | QApplication app(argc, argv); | 40 | QApplication app(argc, argv); | ||
40 | app.setApplicationName(QStringLiteral("kuiserver")); | 41 | app.setApplicationName(QStringLiteral("kuiserver")); | ||
41 | app.setApplicationVersion(QStringLiteral("2.0")); | 42 | app.setApplicationVersion(QStringLiteral("2.0")); | ||
42 | app.setOrganizationDomain(QStringLiteral("kde.org")); | 43 | app.setOrganizationDomain(QStringLiteral("kde.org")); | ||
43 | 44 | | |||
45 | auto disableSessionManagement = [](QSessionManager &sm) { | ||||
46 | sm.setRestartHint(QSessionManager::RestartNever); | ||||
47 | }; | ||||
48 | QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); | ||||
49 | QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); | ||||
50 | | ||||
44 | QCommandLineParser parser; | 51 | QCommandLineParser parser; | ||
45 | parser.addHelpOption(); | 52 | parser.addHelpOption(); | ||
46 | parser.addVersionOption(); | 53 | parser.addVersionOption(); | ||
47 | ProgressListModel model; | 54 | ProgressListModel model; | ||
48 | KDBusService service(KDBusService::Unique); | 55 | KDBusService service(KDBusService::Unique); | ||
49 | 56 | | |||
50 | return app.exec(); | 57 | return app.exec(); | ||
51 | } | 58 | } |