forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kwallet-5.34.0-kwalletd4-5.patch
68 lines (63 loc) · 2.56 KB
/
kwallet-5.34.0-kwalletd4-5.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From e9d8932d04a7882471f722800b7b4603074d560d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <[email protected]>
Date: Sun, 31 May 2015 07:03:31 +0200
Subject: [PATCH 5/5] Replace kwalletd4 after migration has finished
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
kwalletd5 can service both org.kde.kwalletd5 and org.kde.kwalletd
Signed-off-by: Stefan Brüns <[email protected]>
---
src/runtime/kwalletd/kwalletd.cpp | 13 +++++++++++++
src/runtime/kwalletd/kwalletd.h | 1 +
src/runtime/kwalletd/migrationagent.cpp | 1 +
3 files changed, 15 insertions(+)
diff --git a/src/runtime/kwalletd/kwalletd.cpp b/src/runtime/kwalletd/kwalletd.cpp
index 18ef9fa..da851da 100644
--- a/src/runtime/kwalletd/kwalletd.cpp
+++ b/src/runtime/kwalletd/kwalletd.cpp
@@ -151,6 +151,19 @@ KWalletD::KWalletD()
SLOT(slotServiceOwnerChanged(QString, QString, QString)));
}
+void KWalletD::registerKWalletd4Service()
+{
+ auto bus = QDBusConnection::sessionBus().interface();
+ auto reply = bus->registerService(QLatin1String("org.kde.kwalletd"), QDBusConnectionInterface::QueueService);
+ if (reply.isValid() && (reply.value() == QDBusConnectionInterface::ServiceQueued)) {
+ QDBusInterface _kde_kwalletd4("org.kde.kwalletd", "/MainApplication", "org.kde.KApplication");
+ if (_kde_kwalletd4.isValid()) {
+ auto qreply = _kde_kwalletd4.call("quit");
+ }
+ }
+ QDBusConnection::sessionBus().registerObject(QLatin1String("/modules/kwalletd"), this);
+}
+
KWalletD::~KWalletD()
{
#ifdef Q_WS_X11
diff --git a/src/runtime/kwalletd/kwalletd.h b/src/runtime/kwalletd/kwalletd.h
index 3571535..a862faf 100644
--- a/src/runtime/kwalletd/kwalletd.h
+++ b/src/runtime/kwalletd/kwalletd.h
@@ -182,6 +182,7 @@ private Q_SLOTS:
void notifyFailures();
void processTransactions();
void activatePasswordDialog();
+ void registerKWalletd4Service();
#ifdef Q_WS_X11
void connectToScreenSaver();
#endif
diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
index 6eb6013..639ee8d 100644
--- a/src/runtime/kwalletd/migrationagent.cpp
+++ b/src/runtime/kwalletd/migrationagent.cpp
@@ -41,6 +41,7 @@ MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
, _kde4_daemon(nullptr)
, _pam_hash(hash)
{
+ connect(this, &MigrationAgent::migrationFinished, _kf5_daemon, &KWalletD::registerKWalletd4Service);
if (isAlreadyMigrated()) {
qDebug() << "old wallets were already migrated";
emit migrationFinished();
--
2.12.0