OSDN Git Service

debugger: make threadnames feature optional
authorhjk <qtc-committer@nokia.com>
Mon, 20 Dec 2010 16:39:51 +0000 (17:39 +0100)
committerhjk <qtc-committer@nokia.com>
Mon, 20 Dec 2010 16:45:29 +0000 (17:45 +0100)
src/plugins/debugger/debuggeractions.cpp
src/plugins/debugger/debuggeractions.h
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/dumperoptionpage.ui
src/plugins/debugger/gdb/gdbengine.cpp

index 9ff95c8..6ef36ed 100644 (file)
@@ -204,6 +204,13 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
     item->setValue(true);
     insertItem(UseCodeModel, item);
 
+    item = new SavedAction(this);
+    item->setSettingsKey(debugModeGroup, QLatin1String("ShowThreadNames"));
+    item->setCheckable(true);
+    item->setDefaultValue(false);
+    item->setValue(false);
+    insertItem(ShowThreadNames, item);
+
 
     //
     // Breakpoints
index ef9cf22..c6af14c 100644 (file)
@@ -91,6 +91,7 @@ enum DebuggerActionCode
     CustomDebuggingHelperLocation,
 
     UseCodeModel,
+    ShowThreadNames,
 
     UseToolTipsInMainEditor,
     UseToolTipsInLocalsView,
index 264e68a..bef427a 100644 (file)
@@ -694,6 +694,9 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
 
     m_group.insert(debuggerCore()->action(UseCodeModel),
         m_ui.checkBoxUseCodeModel);
+    m_group.insert(debuggerCore()->action(ShowThreadNames),
+        m_ui.checkBoxShowThreadNames);
+
 
 #ifndef QT_DEBUG
 #if 0
@@ -710,7 +713,8 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
                 << ' ' << m_ui.debuggingHelperGroupBox->title()
                 << ' ' << m_ui.customLocationGroupBox->title()
                 << ' ' << m_ui.dumperLocationLabel->text()
-                << ' ' << m_ui.checkBoxUseCodeModel->text();
+                << ' ' << m_ui.checkBoxUseCodeModel->text()
+                << ' ' << m_ui.checkBoxShowThreadNames->text();
         m_searchKeywords.remove(QLatin1Char('&'));
     }
     return w;
index d3899b6..e84f1ab 100644 (file)
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="checkBoxShowThreadNames">
+        <property name="toolTip">
+         <string>Displays names of QThread based threads.</string>
+        </property>
+        <property name="text">
+         <string>Display thread names</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
index 4bd8673..e22acbf 100644 (file)
@@ -3011,7 +3011,7 @@ void GdbEngine::handleThreadInfo(const GdbResponse &response)
         threadsHandler()->setThreads(threads);
         threadsHandler()->setCurrentThreadId(currentThreadId);
         updateViews(); // Adjust Threads combobox.
-        if (m_hasInferiorThreadList) {
+        if (m_hasInferiorThreadList && debuggerCore()->boolSetting(ShowThreadNames)) {
             postCommand("threadnames " +
                 debuggerCore()->action(MaximalStackDepth)->value().toByteArray(),
                 Discardable, CB(handleThreadNames), id);