[SCM] kwallet packaging branch, master, updated. debian/5.37.0-2-96-g74de6bf

Maximiliano Curia maxy at moszumanska.debian.org
Tue Jan 2 18:54:07 UTC 2018


Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/kwallet.git;a=commitdiff;h=ec2df56

The following commit has been merged in the master branch:
commit ec2df562cbe59ae784dabf81701412f70ffde5b3
Author: Harald Sitter <sitter at kde.org>
Date:   Mon Aug 24 13:01:57 2015 +0200

    Add upstream_Stop-showing-the-migration-wizard-by-default.patch to disable the migration wizard dialog. Migration is in fact a non-destructive import, so it can savely be run without any user input. This prevents contextless kwallet dialogs on first login as well as first kwallet5 enabled logins (prequisite for pam unlocking experience)
---
 debian/changelog                                   |  10 ++
 debian/patches/series                              |   1 +
 ...p-showing-the-migration-wizard-by-default.patch | 152 +++++++++++++++++++++
 3 files changed, 163 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 62a18f5..a2e0b1b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+kwallet-kf5 (5.13.0-0ubuntu2) wily; urgency=medium
+
+  * Add upstream_Stop-showing-the-migration-wizard-by-default.patch to disable
+    the migration wizard dialog. Migration is in fact a non-destructive
+    import, so it can savely be run without any user input. This prevents
+    contextless kwallet dialogs on first login as well as first kwallet5
+    enabled logins (prequisite for pam unlocking experience)
+
+ -- Harald Sitter <sitter at kde.org>  Mon, 24 Aug 2015 13:00:08 +0200
+
 kwallet-kf5 (5.13.0-0ubuntu1) wily; urgency=medium
 
   * new upstream release
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..410e400
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+upstream_Stop-showing-the-migration-wizard-by-default.patch
diff --git a/debian/patches/upstream_Stop-showing-the-migration-wizard-by-default.patch b/debian/patches/upstream_Stop-showing-the-migration-wizard-by-default.patch
new file mode 100644
index 0000000..1c5dcb0
--- /dev/null
+++ b/debian/patches/upstream_Stop-showing-the-migration-wizard-by-default.patch
@@ -0,0 +1,152 @@
+From 127efedd1668b546d0ac8c83655a2056d0439f29 Mon Sep 17 00:00:00 2001
+From: Valentin Rusu <kde at rusu.info>
+Date: Fri, 7 Aug 2015 18:59:04 +0200
+Subject: [PATCH] Stop showing the migration wizard by default
+
+BUG:351056
+
+If the migration wizard is needed, then add this to kwalletrc
+[Migration]
+showMigrationWizard=true
+
+On systems having kwallet-pam the migration agent would also merge all the old
+wallets into the default LocalWallet, as a side effect. This would avoid
+wallet creation prompts, though.
+---
+ src/runtime/kwalletd/main.cpp            |  2 +-
+ src/runtime/kwalletd/migrationagent.cpp  | 42 ++++++++++++++++++++++++++------
+ src/runtime/kwalletd/migrationagent.h    |  5 ++--
+ src/runtime/kwalletd/migrationwizard.cpp |  2 +-
+ 4 files changed, 39 insertions(+), 12 deletions(-)
+
+diff --git a/src/runtime/kwalletd/main.cpp b/src/runtime/kwalletd/main.cpp
+index c0fecaa..62fcd3a 100644
+--- a/src/runtime/kwalletd/main.cpp
++++ b/src/runtime/kwalletd/main.cpp
+@@ -186,7 +186,7 @@ int main(int argc, char **argv)
+     aboutdata.addAuthor(i18n("Thiago Maceira"), i18n("D-Bus Interface"), "thiago at kde.org");
+ 
+     KWalletD walletd;
+-    MigrationAgent migrationAgent(&walletd);
++    MigrationAgent migrationAgent(&walletd, hash);
+     KDBusService dbusUniqueInstance(KDBusService::Unique | KDBusService::NoExitOnFailure);
+ 
+     // NOTE: the command should be parsed only after KDBusService instantiation
+diff --git a/src/runtime/kwalletd/migrationagent.cpp b/src/runtime/kwalletd/migrationagent.cpp
+index 6eaeb12..192a871 100644
+--- a/src/runtime/kwalletd/migrationagent.cpp
++++ b/src/runtime/kwalletd/migrationagent.cpp
+@@ -34,10 +34,12 @@
+ 
+ #define SERVICE_KWALLETD4 "org.kde.kwalletd"
+ #define ENTRY_ALREADY_MIGRATED "alreadyMigrated"
++#define ENTRY_SHOW_MIGRATION_WIZARD "showMigrationWizard"
+ 
+-MigrationAgent::MigrationAgent(KWalletD* kd) :
++MigrationAgent::MigrationAgent(KWalletD* kd, const char *hash) :
+   _kf5_daemon(kd)
+   , _kde4_daemon(0)
++  , _pam_hash(hash)
+ {
+   QTimer::singleShot(100, this, SLOT(migrateWallets()));
+ }
+@@ -118,11 +120,27 @@ bool MigrationAgent::isMigrationWizardOk()
+ {
+     bool ok = false;
+ 
+-    MigrationWizard *wizard = new MigrationWizard(this);
+-    int result = wizard->exec();
+-    if (QDialog::Accepted == result) {
+-        // the user either migrated the wallets, or choose not to be prompted again
+-        ok = true;
++    // The migration wizard would no longer been shown by default.
++    // see BUG 351056
++    // NOTE if user wants to show the migration wizard, then he should add the
++    // following setting to the kwalletrc:
++    // [Migration]
++    // showMigrationWizard=true
++    KConfig kwalletrc("kwalletrc");
++    KConfigGroup cfg(&kwalletrc, "Migration");
++    bool showMigrationWizard = cfg.readEntry<bool>(ENTRY_SHOW_MIGRATION_WIZARD, false);
++
++    if (showMigrationWizard) {
++        MigrationWizard *wizard = new MigrationWizard(this);
++        int result = wizard->exec();
++        if (QDialog::Accepted == result) {
++            // the user either migrated the wallets, or choose not to be prompted again
++            ok = true;
++        }
++    } else {
++        if (performMigration(0, true)) {
++            qDebug() << "Migration failed.";
++        }
+     }
+ 
+     return ok;
+@@ -162,7 +180,7 @@ bool MigrationAgent::isEmptyOldWallet() const {
+     return wallets.length() == 0;
+ }
+ 
+-bool MigrationAgent::performMigration(WId wid)
++bool MigrationAgent::performMigration(WId wid, bool withoutWizard)
+ {
+     auto appId = i18n("KDE Wallet Migration Agent");
+     try {
+@@ -174,7 +192,15 @@ bool MigrationAgent::performMigration(WId wid)
+             emit progressMessage(i18n("Migrating wallet: %1", wallet));
+             emit progressMessage(i18n("* Creating KF5 wallet: %1", wallet));
+ 
+-            int handle5 = _kf5_daemon->internalOpen(appId, wallet, false, 0, true, QString());
++            int handle5 = -1;
++            if (withoutWizard && (_pam_hash != nullptr)) {
++                // see BUG 351056 for why this hacky code
++                // If the user has several wallets, all the values will be
++                // merged into the single LocalWallet
++                handle5 = _kf5_daemon->pamOpen(KWallet::Wallet::LocalWallet(), _pam_hash, 0);
++            } else {
++                handle5 = _kf5_daemon->internalOpen(appId, wallet, false, 0, true, QString());
++            }
+             if (handle5 <0) {
+                 emit progressMessage(i18n("ERROR when attempting new wallet creation. Aborting."));
+                 return false;
+diff --git a/src/runtime/kwalletd/migrationagent.h b/src/runtime/kwalletd/migrationagent.h
+index 55a251d..c52509e 100644
+--- a/src/runtime/kwalletd/migrationagent.h
++++ b/src/runtime/kwalletd/migrationagent.h
+@@ -32,10 +32,10 @@ class KWalletD;
+ class MigrationAgent : public QObject {
+     Q_OBJECT
+ public:
+-    MigrationAgent(KWalletD* kd);
++    MigrationAgent(KWalletD* kd, const char* hash);
+ 
+     bool isEmptyOldWallet() const;
+-    bool performMigration(WId wid);
++    bool performMigration(WId wid, bool withoutWizard);
+ 
+ private Q_SLOTS:
+     void migrateWallets();
+@@ -52,6 +52,7 @@ Q_SIGNALS:
+ private:
+     KWalletD		*_kf5_daemon;
+     org::kde::KWallet 	*_kde4_daemon;
++    const char  *_pam_hash;
+ };
+ 
+ #endif // _MIGRATIONAGENT_H_
+diff --git a/src/runtime/kwalletd/migrationwizard.cpp b/src/runtime/kwalletd/migrationwizard.cpp
+index b7d3f70..cdd2a92 100644
+--- a/src/runtime/kwalletd/migrationwizard.cpp
++++ b/src/runtime/kwalletd/migrationwizard.cpp
+@@ -58,7 +58,7 @@ public:
+ 
+     virtual void initializePage() {
+         connect(_agent, SIGNAL(progressMessage(QString)), _ui._report, SLOT(append(QString)));
+-        _migrationCompleted = _agent->performMigration(winId());
++        _migrationCompleted = _agent->performMigration(winId(), false);
+         emit completeChanged();
+     }
+ 
+-- 
+2.1.4
+

-- 
kwallet packaging



More information about the pkg-kde-commits mailing list