Commit 24e43c52 authored by David Edmundson's avatar David Edmundson
Browse files

[emojier] disable session manager

Summary: Code is copy pasted from elsewhere

Reviewers: #plasma, apol, ngraham

Reviewed By: apol, ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25826
parent 84ebbd14
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusMessage> #include <QDBusMessage>
#include <QDBusConnectionInterface> #include <QDBusConnectionInterface>
#include <QSessionManager>
#include "emojiersettings.h" #include "emojiersettings.h"
#include "config-workspace.h" #include "config-workspace.h"
...@@ -327,6 +328,7 @@ public: ...@@ -327,6 +328,7 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
QGuiApplication::setFallbackSessionManagementEnabled(false);
QApplication app(argc, argv); QApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-emoticons"))); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-emoticons")));
...@@ -343,6 +345,12 @@ int main(int argc, char** argv) ...@@ -343,6 +345,12 @@ int main(int argc, char** argv)
about.setProgramLogo(app.windowIcon()); about.setProgramLogo(app.windowIcon());
KAboutData::setApplicationData(about); KAboutData::setApplicationData(about);
auto disableSessionManagement = [](QSessionManager &sm) {
sm.setRestartHint(QSessionManager::RestartNever);
};
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
KDBusService::StartupOptions startup = nullptr; KDBusService::StartupOptions startup = nullptr;
{ {
QCommandLineParser parser; QCommandLineParser parser;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment