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 reply = iface->open( QLatin1String("kdewallet"), 0, q->service() ); + const QDBusPendingReply 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 reply = *watcher; + const QDBusPendingReply 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 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 );