Search
j0ke.net Open Build Service
>
Projects
>
home:netmax
:
playground
>
opt-libqtkeychain
> use_network_wallet.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File use_network_wallet.diff of Package opt-libqtkeychain
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 @@ class ReadPasswordJobPrivate : public QObject { 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 );