[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/certmanager/kwatchgnupg
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-04-19 13:58:26
Message-ID: 20040419135826.E6AEA99FE () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Prevent endless recursion: According to the KProcIO docs, you can call ackRead() in a \
slot connected to readReady(). Apparently, you can not:

KProcIO::ackRead() calls KProcIO::controlledEmission(), which emits
readReady(). :o

Fixed by adding a single-shot timer connected to slot that calls ackRead() for us, \
after we've re-entered the event loop. So why is KProcIO::ackRead() not a slot in the \
first place??


  M +9 -1      kwatchgnupgmainwin.cpp   1.10
  M +1 -0      kwatchgnupgmainwin.h   1.6


--- kdepim/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp  #1.9:1.10
@@ -51,4 +51,5 @@
 #include <qdir.h>
 #include <qeventloop.h>
+#include <qtimer.h>
 
 #define WATCHGNUPGBINARY "watchgnupg"
@@ -180,4 +181,6 @@ void KWatchGnuPGMainWindow::slotWatcherE
 void KWatchGnuPGMainWindow::slotReadStdout()
 {
+  if ( !mWatcher )
+    return;
   QString str;
   while( mWatcher->readln(str,false) > 0 ) {
@@ -189,4 +192,9 @@ void KWatchGnuPGMainWindow::slotReadStdo
         }
   }
+  QTimer::singleShot( 0, this, SLOT(slotAckRead()) );
+}
+
+void KWatchGnuPGMainWindow::slotAckRead() {
+  if ( mWatcher )
   mWatcher->ackRead();
 }

--- kdepim/certmanager/kwatchgnupg/kwatchgnupgmainwin.h  #1.5:1.6
@@ -49,4 +49,5 @@ public slots:
   void slotWatcherExited();
   void slotReadStdout();
+  void slotAckRead();
 
   void slotSaveAs();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic