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

List:       kde-commits
Subject:    kdevelop/parts/debugger
From:       John Birch <jbb () kdevelop ! org>
Date:       2003-09-12 22:55:08
[Download RAW message or body]

CVS commit by jb: 

Shutdown from the popdown menu on main toolbar has stopped working.
The QTimer wasn't being triggered. So I've removed the timer...


  M +17 -28    gdbcontroller.cpp   1.56
  M +0 -5      gdbcontroller.h   1.24


--- kdevelop/parts/debugger/gdbcontroller.cpp  #1.55:1.56
@@ -33,8 +33,8 @@
 #include <kprocess.h>
 
+#include <qdatetime.h>
+#include <qfileinfo.h>
 #include <qregexp.h>
 #include <qstring.h>
-#include <qtimer.h>
-#include <qfileinfo.h>
 
 #include <iostream>
@@ -1325,24 +1325,21 @@ void GDBController::slotStopDebugger()
 
         pauseApp();
-        setStateOn(s_waitTimer);
-
-        QTimer *timer;
-
-        timer = new QTimer(this);
-        connect(timer, SIGNAL(timeout()), this, SLOT(slotAbortTimedEvent()) );
+        QTime start;
+        QTime now;
 
         if (stateIsOn(s_attached))
         {
-            setStateOn(s_waitTimer|s_appBusy);
+            setStateOn(s_appBusy);
             const char *detach="detach\n";
             dbgProcess_->writeStdin(detach, strlen(detach));
             emit gdbStdout(detach);
-            timer->start(3000, TRUE);
             DBG_DISPLAY("<detach wait>");
-            while (stateIsOn(s_waitTimer))
+            start = QTime::currentTime();
+            while (-1)
             {
-                if (!stateIsOn(s_attached))
-                    break;
                 kapp->processEvents(20);
+                now = QTime::currentTime();
+                if (!stateIsOn(s_attached) || start.msecsTo( now ) > 2000)
+                    break;
             }
         }
@@ -1356,15 +1353,16 @@ void GDBController::slotStopDebugger()
 //         }
 
-        setStateOn(s_waitTimer|s_appBusy);
+        setStateOn(s_appBusy);
         const char *quit="quit\n";
         dbgProcess_->writeStdin(quit, strlen(quit));
         emit gdbStdout(quit);
-        timer->start(3000, TRUE);
         DBG_DISPLAY("<quit wait>");
-        while (stateIsOn(s_waitTimer))
+        start = QTime::currentTime();
+        while (-1)
         {
-            if (stateIsOn(s_programExited))
-                break;
             kapp->processEvents(20);
+          now = QTime::currentTime();
+          if (stateIsOn(s_programExited) || start.msecsTo( now ) > 2000)
+            break;
         }
 
@@ -1928,13 +1926,4 @@ void GDBController::slotDbgProcessExited
 
     emit gdbStdout("(gdb) Process exited\n");
-}
-
-// **************************************************************************
-
-// The time limit has expired so set the state off.
-void GDBController::slotAbortTimedEvent()
-{
-    setStateOff(s_waitTimer);
-    DBG_DISPLAY(QString("Timer aborted"));
 }
 

--- kdevelop/parts/debugger/gdbcontroller.h  #1.23:1.24
@@ -126,9 +126,4 @@ protected slots:
     void slotDbgWroteStdin(KProcess *proc);
     void slotDbgProcessExited(KProcess *proc);
-//    void slotStepInSource(const QString &fileName, int lineNum);
-//    void slotDbgStatus(const QString &status, int state);
-
-private slots:
-    void slotAbortTimedEvent();
 
 signals:


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

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