OSDN Git Service

GCC: Improve abi widget handling
authorTobias Hunger <tobias.hunger@nokia.com>
Mon, 27 Jun 2011 15:24:54 +0000 (17:24 +0200)
committerTobias Hunger <tobias.hunger@nokia.com>
Mon, 27 Jun 2011 15:26:54 +0000 (17:26 +0200)
Change-Id: I296848c0615fe0aca0dff3324054be7d7ec86b52
Reviewed-on: http://codereview.qt.nokia.com/785
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
src/plugins/projectexplorer/gcctoolchain.cpp
src/plugins/projectexplorer/gcctoolchainfactories.h

index 71dffd0..a097677 100644 (file)
@@ -607,7 +607,8 @@ QList<ToolChain *> Internal::GccToolChainFactory::autoDetectToolchains(const QSt
 Internal::GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) :
     ToolChainConfigWidget(tc),
     m_compilerPath(new Utils::PathChooser),
-    m_abiWidget(new AbiWidget)
+    m_abiWidget(new AbiWidget),
+    m_isReadOnly(false)
 {
     Q_ASSERT(tc);
 
@@ -654,6 +655,8 @@ void Internal::GccToolChainConfigWidget::setFromToolchain()
     GccToolChain *tc = static_cast<GccToolChain *>(toolChain());
     m_compilerPath->setPath(tc->compilerPath());
     m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
+    if (!m_isReadOnly && !m_compilerPath->path().isEmpty())
+        m_abiWidget->setEnabled(true);
     setDebuggerCommand(tc->debuggerCommand());
     blockSignals(blocked);
 }
@@ -670,6 +673,7 @@ void Internal::GccToolChainConfigWidget::makeReadOnly()
 {
     m_compilerPath->setEnabled(false);
     m_abiWidget->setEnabled(false);
+    m_isReadOnly = true;
     ToolChainConfigWidget::makeReadOnly();
 }
 
index ff3feb2..1c51548 100644 (file)
@@ -105,6 +105,7 @@ private:
     QString m_autoDebuggerCommand;
 
     QList<Abi> m_abiList;
+    bool m_isReadOnly;
 };
 
 // --------------------------------------------------------------------------