summaryrefslogtreecommitdiffstats
path: root/libkdenetwork
diff options
context:
space:
mode:
Diffstat (limited to 'libkdenetwork')
-rw-r--r--libkdenetwork/gpgmepp/callbacks.cpp7
-rw-r--r--libkdenetwork/qgpgme/eventloopinteractor.cpp15
2 files changed, 19 insertions, 3 deletions
diff --git a/libkdenetwork/gpgmepp/callbacks.cpp b/libkdenetwork/gpgmepp/callbacks.cpp
index 268c280ef..3913b6fbb 100644
--- a/libkdenetwork/gpgmepp/callbacks.cpp
+++ b/libkdenetwork/gpgmepp/callbacks.cpp
@@ -64,9 +64,10 @@ gpgme_error_t passphrase_callback( void * opaque, const char * uid_hint, const c
bool canceled = false;
gpgme_error_t err = GPG_ERR_NO_ERROR;
char * passphrase = provider ? provider->getPassphrase( uid_hint, desc, prev_was_bad, canceled ) : 0 ;
- if ( canceled )
+ if ( canceled ) {
err = makeError( GPG_ERR_CANCELED );
- else
+ }
+ else {
if ( passphrase && *passphrase ) {
size_t passphrase_length = strlen( passphrase );
size_t written = 0;
@@ -79,7 +80,7 @@ gpgme_error_t passphrase_callback( void * opaque, const char * uid_hint, const c
written += now_written;
} while ( written < passphrase_length );
}
-
+ }
if ( passphrase && *passphrase )
wipe( passphrase, strlen( passphrase ) );
free( passphrase );
diff --git a/libkdenetwork/qgpgme/eventloopinteractor.cpp b/libkdenetwork/qgpgme/eventloopinteractor.cpp
index fdf25af04..197fd3ba1 100644
--- a/libkdenetwork/qgpgme/eventloopinteractor.cpp
+++ b/libkdenetwork/qgpgme/eventloopinteractor.cpp
@@ -30,6 +30,11 @@
#include <tqsocketnotifier.h>
#include <tqapplication.h>
+#include <tqvaluelist.h>
+
+TQValueList<int> writeActivity;
+TQValueList<int> readActivity;
+
using namespace GpgME;
QGpgME::EventLoopInteractor::EventLoopInteractor( TQObject * parent, const char * name )
@@ -77,11 +82,21 @@ void QGpgME::EventLoopInteractor::unregisterWatcher( void * tag ) {
}
void QGpgME::EventLoopInteractor::slotWriteActivity( int socket ) {
+ if (writeActivity.contains(socket)) {
+ return;
+ }
+ writeActivity.append(socket);
actOn( socket , Write );
+ writeActivity.remove(socket);
}
void QGpgME::EventLoopInteractor::slotReadActivity( int socket ) {
+ if (readActivity.contains(socket)) {
+ return;
+ }
+ readActivity.append(socket);
actOn( socket , Read );
+ readActivity.remove(socket);
}
void QGpgME::EventLoopInteractor::nextTrustItemEvent( GpgME::Context * context, const GpgME::TrustItem & item ) {