Detect if opening the wallet failed.

(Assuming that the user denied access)
This commit is contained in:
Frank Osterfeld 2012-05-08 17:38:14 +02:00
parent 7573b17ba6
commit be96f4c514
1 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,11 @@ void ReadPasswordJob::Private::kwalletOpenFinished( QDBusPendingCallWatcher* wat
walletHandle = reply.value();
if ( walletHandle < 0 ) {
q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
return;
}
const QDBusPendingReply<int> nextReply = iface->entryType( walletHandle, q->service(), key, q->service() );
QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletEntryTypeFinished(QDBusPendingCallWatcher*)) );
@ -93,6 +98,11 @@ void WritePasswordJob::Private::kwalletOpenFinished( QDBusPendingCallWatcher* wa
const int handle = reply.value();
if ( handle < 0 ) {
q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
return;
}
QDBusPendingReply<int> nextReply;
if ( !textData.isEmpty() )