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

List:       kde-commits
Subject:    kdevelop/parts/debugger
From:       Hamish Rodda <meddie () yoyo ! its ! monash ! edu ! au>
Date:       2003-06-10 15:55:50
[Download RAW message or body]

CVS commit by rodda: 

Close drkonqi 15 seconds after queueing the attachment gdb command.
Ideally we need a callback when the attachment is successful so we can
close drkonqi without losing our process, but without waiting for an
arbitrary amount of time with our fingers crossed.

Any other ideas? or a volunteer to create an attached() signal in
GDBController?


  M +19 -6     debuggerpart.cpp   1.77
  M +4 -2      debuggerpart.h   1.25


--- kdevelop/parts/debugger/debuggerpart.cpp  #1.76:1.77
@@ -30,4 +30,5 @@
 #include <kapplication.h>
 #include <dcopclient.h>
+#include <qtimer.h>
 
 #include "kdevcore.h"
@@ -351,9 +352,19 @@ ASYNC DebuggerPart::slotDebugExternalPro
     d >> pid;
 
-    attachProcess(pid);
+    if (attachProcess(pid) && m_drkonqi.isEmpty()) {
+        m_drkonqi = kapp->dcopClient()->senderId();
+        QTimer::singleShot(15000, this, SLOT(slotCloseDrKonqi()));
     mainWindow()->raiseView(framestackWidget);
+    }
+
     mainWindow()->main()->raise();
 }
 
+void DebuggerPart::slotCloseDrKonqi()
+{
+    kapp->dcopClient()->send(m_drkonqi, "MainApplication-Interface", "quit()", QByteArray());
+    m_drkonqi = "";
+}
+
 DebuggerPart::~DebuggerPart()
 {
@@ -523,5 +534,5 @@ void DebuggerPart::setupController()
 
 
-void DebuggerPart::startDebugger()
+bool DebuggerPart::startDebugger()
 {
     QString program;
@@ -544,5 +555,5 @@ void DebuggerPart::startDebugger()
                 i18n("Could not locate the debugging shell '%1'.").arg( shell ),
                 i18n("Debugging shell not found.") );
-            return;
+            return false;
         }
     }
@@ -582,4 +593,5 @@ void DebuggerPart::startDebugger()
 
     controller->slotStart(shell, program);
+    return true;
 }
 
@@ -673,10 +685,11 @@ void DebuggerPart::slotAttachProcess()
 }
 
-void DebuggerPart::attachProcess(int pid)
+bool DebuggerPart::attachProcess(int pid)
 {
     mainWindow()->statusBar()->message(i18n("Attaching to process %1").arg(pid), 1000);
 
-    startDebugger();
+    bool ret = startDebugger();
     controller->slotAttachTo(pid);
+    return ret;
 }
 

--- kdevelop/parts/debugger/debuggerpart.h  #1.24:1.25
@@ -84,8 +84,9 @@ private slots:
 
     void slotDCOPApplicationRegistered(const QCString &appId);
+    void slotCloseDrKonqi();
 
 private:
-    void attachProcess(int pid);
-    void startDebugger();
+    bool attachProcess(int pid);
+    bool startDebugger();
     void setupController();
 
@@ -102,4 +103,5 @@ private:
 
     QString m_contextIdent;
+    QCString m_drkonqi;
 };
 


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

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