[Pkg-owncloud-commits] [qtkeychain] 76/115: Use network wallet rather than hardcoded "kdewallet" wallet

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 19:25:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository qtkeychain.

commit bc9bb279ecc34744270a7674e33bdbd50aab9fa3
Author: Daniel Molkentin <daniel at molkentin.de>
Date:   Thu Aug 22 10:58:46 2013 +0200

    Use network wallet rather than hardcoded "kdewallet" wallet
    
    Fixes #9
---
 keychain_dbus.cpp | 13 +++++++++++--
 keychain_p.h      |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/keychain_dbus.cpp b/keychain_dbus.cpp
index 4b39348..15e0ee1 100644
--- a/keychain_dbus.cpp
+++ b/keychain_dbus.cpp
@@ -170,9 +170,9 @@ void ReadPasswordJobPrivate::scheduledStart() {
         if ( QDBusConnection::sessionBus().isConnected() )
         {
             iface = new org::kde::KWallet( QLatin1String("org.kde.kwalletd"), QLatin1String("/modules/kwalletd"), QDBusConnection::sessionBus(), this );
-            const QDBusPendingReply<int> reply = iface->open( QLatin1String("kdewallet"), 0, q->service() );
+            const QDBusPendingReply<QString> reply = iface->networkWallet();
             QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher( reply, this );
-            connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) );
+            connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletWalletFound(QDBusPendingCallWatcher*)) );
         }
         else
         {
@@ -184,6 +184,15 @@ void ReadPasswordJobPrivate::scheduledStart() {
     }
 }
 
+void ReadPasswordJobPrivate::kwalletWalletFound(QDBusPendingCallWatcher *watcher)
+{
+    watcher->deleteLater();
+    const QDBusPendingReply<QString> reply = *watcher;
+    const QDBusPendingReply<int> pendingReply = iface->open( reply.value(), 0, q->service() );
+    QDBusPendingCallWatcher* pendingWatcher = new QDBusPendingCallWatcher( pendingReply, this );
+    connect( pendingWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) );
+}
+
 static QPair<Error, QString> mapGnomeKeyringError( int result )
 {
     Q_ASSERT( result != GnomeKeyring::RESULT_OK );
diff --git a/keychain_p.h b/keychain_p.h
index 4facbc6..31fad8a 100644
--- a/keychain_p.h
+++ b/keychain_p.h
@@ -74,6 +74,7 @@ public:
     const QString typeKey();
     const QString dataKey();
 private Q_SLOTS:
+    void kwalletWalletFound( QDBusPendingCallWatcher* watcher );
     void kwalletOpenFinished( QDBusPendingCallWatcher* watcher );
     void kwalletEntryTypeFinished( QDBusPendingCallWatcher* watcher );
     void kwalletReadFinished( QDBusPendingCallWatcher* watcher );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/qtkeychain.git



More information about the Pkg-owncloud-commits mailing list