From a053724c28d128a44b36d26eb1f3257b9046879a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 6 Mar 2015 15:13:21 +0100 Subject: Debugger: Refresh list of debuggers in kits options page on changes Task-number: QTCREATORBUG-13991 Change-Id: I06ff6daea88e14b4193e4f1a71d768b528d80bf9 Reviewed-by: hjk --- src/plugins/debugger/debuggerkitconfigwidget.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/plugins/debugger/debuggerkitconfigwidget.cpp') diff --git a/src/plugins/debugger/debuggerkitconfigwidget.cpp b/src/plugins/debugger/debuggerkitconfigwidget.cpp index bf6009867c..111f228d7d 100644 --- a/src/plugins/debugger/debuggerkitconfigwidget.cpp +++ b/src/plugins/debugger/debuggerkitconfigwidget.cpp @@ -69,14 +69,11 @@ namespace Internal { // ----------------------------------------------------------------------- DebuggerKitConfigWidget::DebuggerKitConfigWidget(Kit *workingCopy, const KitInformation *ki) - : KitConfigWidget(workingCopy, ki) + : KitConfigWidget(workingCopy, ki), + m_ignoreChanges(false) { m_comboBox = new QComboBox; m_comboBox->setEnabled(true); - m_comboBox->setToolTip(toolTip()); - m_comboBox->addItem(tr("None"), QString()); - foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) - m_comboBox->addItem(item.displayName(), item.id()); refresh(); connect(m_comboBox, static_cast(&QComboBox::currentIndexChanged), @@ -112,8 +109,16 @@ void DebuggerKitConfigWidget::makeReadOnly() void DebuggerKitConfigWidget::refresh() { + m_ignoreChanges = true; + m_comboBox->clear(); + m_comboBox->setToolTip(toolTip()); + m_comboBox->addItem(tr("None"), QString()); + foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) + m_comboBox->addItem(item.displayName(), item.id()); + const DebuggerItem *item = DebuggerKitInformation::debugger(m_kit); updateComboBox(item ? item->id() : QVariant()); + m_ignoreChanges = false; } QWidget *DebuggerKitConfigWidget::buttonWidget() const @@ -134,6 +139,9 @@ void DebuggerKitConfigWidget::manageDebuggers() void DebuggerKitConfigWidget::currentDebuggerChanged(int) { + if (m_ignoreChanges) + return; + int currentIndex = m_comboBox->currentIndex(); QVariant id = m_comboBox->itemData(currentIndex); m_kit->setValue(DebuggerKitInformation::id(), id); -- cgit v1.2.1