[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kwallet] src/runtime/kwalletd: disable seession restore for kwalletd5
From:       Weng Xuetian <wengxt () gmail ! com>
Date:       2016-04-06 14:53:08
Message-ID: E1anopQ-0006dx-N0 () scm ! kde ! org
[Download RAW message or body]

Git commit c3cd7b72b3b1c2a6f13225c0d9141992e1cc024d by Weng Xuetian.
Committed on 06/04/2016 at 14:49.
Pushed by xuetianweng into branch 'master'.

disable seession restore for kwalletd5

kwalletd5 may be started by session manager before kwallet-pam starts
its own kwalletd.

REVIEW: 127271

M  +6    -0    src/runtime/kwalletd/main.cpp

http://commits.kde.org/kwallet-framework/c3cd7b72b3b1c2a6f13225c0d9141992e1cc024d

diff --git a/src/runtime/kwalletd/main.cpp b/src/runtime/kwalletd/main.cpp
index 740e670..90c60d8 100644
--- a/src/runtime/kwalletd/main.cpp
+++ b/src/runtime/kwalletd/main.cpp
@@ -21,6 +21,7 @@
 #include <QApplication>
 #include <QDebug>
 #include <QtCore/QString>
+#include <QSessionManager>
 #include <KLocalizedString>
 #include <KAboutData>
 #include <KConfig>
@@ -200,6 +201,11 @@ int main(int argc, char **argv)
     aboutdata.setProgramIconName(QStringLiteral("kwalletmanager"));
 
     app.setQuitOnLastWindowClosed(false);
+    auto disableSessionManagement = [](QSessionManager &sm) {
+        sm.setRestartHint(QSessionManager::RestartNever);
+    };
+    QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
+    QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
 
     // check if kwallet is disabled
     if (!isWalletEnabled()) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic