Skip to content

Commit bb512c8

Browse files
KWallet: Fix deleting entries
Do not leave empty entries, but actually delete them. Fixes frankosterfeld#199
1 parent 5d87cd2 commit bb512c8

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

keychain_unix.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,16 @@ void JobPrivate::kwalletOpenFinished( QDBusPendingCallWatcher* watcher ) {
512512

513513
QDBusPendingReply<int> nextReply;
514514

515-
if ( mode == Text )
516-
nextReply = iface->writePassword( handle, q->service(), key, QString::fromUtf8(data), q->service() );
517-
else if ( mode == Binary )
518-
nextReply = iface->writeEntry( handle, q->service(), key, data, q->service() );
519-
else
515+
if ( !data.isNull() ) {
516+
if ( mode == Text ) {
517+
nextReply = iface->writePassword( handle, q->service(), key, QString::fromUtf8(data), q->service() );
518+
} else {
519+
Q_ASSERT( mode == Binary );
520+
nextReply = iface->writeEntry( handle, q->service(), key, data, q->service() );
521+
}
522+
} else {
520523
nextReply = iface->removeEntry( handle, q->service(), key, q->service() );
524+
}
521525

522526
QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
523527
connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletFinished(QDBusPendingCallWatcher*)) );

0 commit comments

Comments
 (0)