summaryrefslogtreecommitdiffstats
path: root/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp')
-rw-r--r--certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp b/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp
index 9e663e92d..b07135f01 100644
--- a/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp
+++ b/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp
@@ -48,6 +48,7 @@
#include <kdebug.h>
#include <tqstringlist.h>
+#include <tqtimer.h>
#include <algorithm>
@@ -97,6 +98,10 @@ GpgME::Error Kleo::QGpgMEKeyListJob::start( const TQStringList & pats, bool secr
kdDebug(5150) << "QGpgMEKeyListJob::start(): retrying keylisting with chunksize " << chunkSize() << endl;
continue;
}
+ } else if ( err.code() == GPG_ERR_EOF ) {
+ kdDebug(5150) << "QGpgMEKeyListJob::start(): early end of keylisting, trying to fake an empty result" << endl;
+ TQTimer::singleShot( 10, this, TQT_SLOT(slotFakeOperationDoneEvent()) );
+ return GpgME::Error();
}
deleteLater();
mResult = GpgME::KeyListResult( 0, err );
@@ -158,6 +163,17 @@ void Kleo::QGpgMEKeyListJob::slotNextKeyEvent( GpgME::Context * context, const G
emit nextKey( key );
}
+void Kleo::QGpgMEKeyListJob::slotFakeOperationDoneEvent() {
+ const GpgME::KeyListResult res = mCtx->keyListResult();
+ if ( !res.error().code() == GPG_ERR_EOF )
+ kdDebug(5150) << "QGpgMEKeyListJob::slotFakeOperationDoneEvent: expected EOF, got "
+ << res.error().asString() << endl;
+ mResult = GpgME::KeyListResult();
+ emit done();
+ emit result( mResult );
+ deleteLater();
+}
+
void Kleo::QGpgMEKeyListJob::slotOperationDoneEvent( GpgME::Context * context, const GpgME::Error & ) {
if ( context != mCtx )
return;