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
|
From f63407a129910cac5b2f7bbf56a348932fdeb05a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 31 May 2015 06:56:44 +0200
Subject: [PATCH 2/5] Only start timer for migration agent if necessary
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
src/runtime/kwalletd/migrationagent.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
index f3da947..110a5e0 100644
--- a/src/runtime/kwalletd/migrationagent.cpp
+++ b/src/runtime/kwalletd/migrationagent.cpp
@@ -41,7 +41,11 @@ MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
, _kde4_daemon(nullptr)
, _pam_hash(hash)
{
- QTimer::singleShot(100, this, SLOT(migrateWallets()));
+ if (isAlreadyMigrated()) {
+ qDebug() << "old wallets were already migrated";
+ } else {
+ QTimer::singleShot(100, this, SLOT(migrateWallets()));
+ }
}
void MigrationAgent::migrateWallets()
@@ -55,7 +59,7 @@ void MigrationAgent::migrateWallets()
// if the migration wizard returns without error
// create "alreadyMigrated=true" setting
qDebug() << "Migration agent starting...";
- if (!isAlreadyMigrated()) {
+ {
if (connectOldDaemon()) {
if (!isEmptyOldWallet()) {
if (isMigrationWizardOk()) {
@@ -70,8 +74,6 @@ void MigrationAgent::migrateWallets()
} else {
qDebug() << "KDE4 kwalletd not present, stopping migration agent";
}
- } else {
- qDebug() << "old wallets were already migrated";
}
qDebug() << "Migration agent stop.";
}
--
2.12.0
|