From b65bbff491a80ad835885aed2606a3099c4701ba Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 23 Sep 2009 15:32:22 +0200
Subject: [PATCH] debugger: split connectDebuggingHelperActions(bool) into
 connect* and disconnect*

---
 src/plugins/debugger/gdb/gdbengine.cpp | 33 +++++++++++++-------------
 src/plugins/debugger/gdb/gdbengine.h   |  3 ++-
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 0b4b671acfe..cabd1310259 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -199,22 +199,23 @@ GdbEngine::GdbEngine(DebuggerManager *parent) :
         Qt::QueuedConnection);
 }
 
-void GdbEngine::connectDebuggingHelperActions(bool on)
-{
-    if (on) {
-        connect(theDebuggerAction(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
-                this, SLOT(setUseDebuggingHelpers(QVariant)));
-        connect(theDebuggerAction(DebugDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
-                this, SLOT(setDebugDebuggingHelpers(QVariant)));
-        connect(theDebuggerAction(RecheckDebuggingHelpers), SIGNAL(triggered()),
-                this, SLOT(recheckDebuggingHelperAvailability()));
-    } else {
-        disconnect(theDebuggerAction(UseDebuggingHelpers), 0, this, 0);
-        disconnect(theDebuggerAction(DebugDebuggingHelpers), 0, this, 0);
-        disconnect(theDebuggerAction(RecheckDebuggingHelpers), 0, this, 0);
-    }
+void GdbEngine::connectDebuggingHelperActions()
+{
+    connect(theDebuggerAction(UseDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
+            this, SLOT(setUseDebuggingHelpers(QVariant)));
+    connect(theDebuggerAction(DebugDebuggingHelpers), SIGNAL(valueChanged(QVariant)),
+            this, SLOT(setDebugDebuggingHelpers(QVariant)));
+    connect(theDebuggerAction(RecheckDebuggingHelpers), SIGNAL(triggered()),
+            this, SLOT(recheckDebuggingHelperAvailability()));
 }
    
+void GdbEngine::disconnectDebuggingHelperActions()
+{
+    disconnect(theDebuggerAction(UseDebuggingHelpers), 0, this, 0);
+    disconnect(theDebuggerAction(DebugDebuggingHelpers), 0, this, 0);
+    disconnect(theDebuggerAction(RecheckDebuggingHelpers), 0, this, 0);
+}
+
 DebuggerStartMode GdbEngine::startMode() const
 {
     QTC_ASSERT(!m_startParameters.isNull(), return NoStartMode);
@@ -1515,7 +1516,7 @@ void GdbEngine::detachDebugger()
 
 void GdbEngine::exitDebugger()
 {
-    connectDebuggingHelperActions(false);
+    disconnectDebuggingHelperActions();
     m_outputCollector.shutdown();
     initializeVariables();
     m_gdbAdapter->shutdown();
@@ -1536,7 +1537,7 @@ void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
 
     m_startParameters = sp;
     if (startModeAllowsDumpers())
-        connectDebuggingHelperActions(true);
+        connectDebuggingHelperActions();
 
     if (m_gdbAdapter)
         disconnectAdapter();
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index 765a958add3..d39546f9b81 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -411,7 +411,8 @@ private:
     void setWatchDataType(WatchData &data, const GdbMi &mi);
     void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);
     void setLocals(const QList<GdbMi> &locals);
-    void connectDebuggingHelperActions(bool on);
+    void connectDebuggingHelperActions();
+    void disconnectDebuggingHelperActions();
    
     bool startModeAllowsDumpers() const;
     QString parseDisassembler(const GdbMi &lines);
-- 
GitLab