From f63407a129910cac5b2f7bbf56a348932fdeb05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= 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 --- 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