diff --git a/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp b/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp index ebf417a891e..1797c9c5285 100644 --- a/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp +++ b/src/plugins/qt4projectmanager/debugginghelperbuildtask.cpp @@ -106,6 +106,11 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, m_qmakeCommand = version->qmakeCommand(); m_makeCommand = tc->makeCommand(); m_mkspec = version->mkspec(); + + // Make sure QtVersion cache is invalidated + connect(this, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)), + QtVersionManager::instance(), SLOT(updateQtVersion(int)), + Qt::QueuedConnection); } DebuggingHelperBuildTask::~DebuggingHelperBuildTask() diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index dc8684cdcdd..45669a776fb 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -451,6 +451,8 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) this, SLOT(qtVersionChanged())); connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()), this, SLOT(qmakeBuildConfigChanged())); + connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)), + this, SLOT(qtVersionsUpdated(QString))); } void QMakeStepConfigWidget::init() @@ -482,6 +484,12 @@ void QMakeStepConfigWidget::qtVersionChanged() updateQmlDebuggingOption(); } +void QMakeStepConfigWidget::qtVersionsUpdated(const QString &qmakeCommand) +{ + if (m_step->qt4BuildConfiguration()->qtVersion()->qmakeCommand() == qmakeCommand) + qtVersionChanged(); +} + void QMakeStepConfigWidget::qmakeBuildConfigChanged() { Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration(); @@ -510,7 +518,6 @@ void QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged() { if (m_ignoreChange) return; - m_ui.qmlDebuggingLibraryCheckBox->setEnabled(m_step->isQmlDebuggingLibrarySupported()); m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary()); updateSummaryLabel(); @@ -576,10 +583,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper() DebuggingHelperBuildTask *buildTask = new DebuggingHelperBuildTask(version, DebuggingHelperBuildTask::QmlDebugging); - connect(buildTask, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)), - this, SLOT(debuggingHelperBuildFinished(int,QString)), - Qt::QueuedConnection); - // pop up Application Output on error buildTask->showOutputOnError(true); @@ -589,20 +592,6 @@ void QMakeStepConfigWidget::buildQmlDebuggingHelper() QLatin1String("Qt4ProjectManager::BuildHelpers")); } -void QMakeStepConfigWidget::debuggingHelperBuildFinished(int qtVersionId, const QString &output) -{ - BaseQtVersion *version = QtVersionManager::instance()->version(qtVersionId); - if (!version) // qt version got deleted in between - return; - - if (version == m_step->qt4BuildConfiguration()->qtVersion()) { - m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary()); - updateSummaryLabel(); - updateEffectiveQMakeCall(); - updateQmlDebuggingOption(); - } -} - void QMakeStepConfigWidget::updateSummaryLabel() { Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration(); diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h index 69ac9cf30c1..0bfa41a7401 100644 --- a/src/plugins/qt4projectmanager/qmakestep.h +++ b/src/plugins/qt4projectmanager/qmakestep.h @@ -137,6 +137,7 @@ public: private slots: // slots for handling buildconfiguration/step signals void qtVersionChanged(); + void qtVersionsUpdated(const QString &qmakeCommand); void qmakeBuildConfigChanged(); void userArgumentsChanged(); void linkQmlDebuggingLibraryChanged(); @@ -148,7 +149,6 @@ private slots: // other void buildQmlDebuggingHelper(); - void debuggingHelperBuildFinished(int qtVersionId, const QString &output); private: void updateSummaryLabel(); diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp index dcc0f7d9934..78322581e4a 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.cpp +++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp @@ -192,6 +192,9 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList connect(m_ui->cleanUpButton, SIGNAL(clicked()), this, SLOT(cleanUpQtVersions())); userChangedCurrentVersion(); updateCleanUpButton(); + + connect(QtVersionManager::instance(), SIGNAL(qtVersionsUpdated(QString)), + this, SLOT(qtVersionsUpdated(QString))); } bool QtOptionsPageWidget::eventFilter(QObject *o, QEvent *e) @@ -270,6 +273,7 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS if (index == currentIndex()) { updateDebuggingHelperUi(); } + if (!success) showDebuggingBuildLog(item); } @@ -304,6 +308,19 @@ void QtOptionsPageWidget::cleanUpQtVersions() updateCleanUpButton(); } +void QtOptionsPageWidget::qtVersionsUpdated(const QString &qmakeCommand) +{ + foreach (BaseQtVersion *version, m_versions) { + if (version->qmakeCommand() == qmakeCommand) + version->recheckDumper(); + } + if (currentVersion()->qmakeCommand() == qmakeCommand) { + updateWidgets(); + updateDescriptionLabel(); + updateDebuggingHelperUi(); + } +} + void QtOptionsPageWidget::buildDebuggingHelper(DebuggingHelperBuildTask::Tools tools) { const int index = currentIndex(); diff --git a/src/plugins/qt4projectmanager/qtoptionspage.h b/src/plugins/qt4projectmanager/qtoptionspage.h index 08fd4d79b1c..3512fd14f15 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.h +++ b/src/plugins/qt4projectmanager/qtoptionspage.h @@ -107,6 +107,8 @@ private slots: void slotShowDebuggingBuildLog(); void debuggingHelperBuildFinished(int qtVersionId, const QString &output, DebuggingHelperBuildTask::Tools tools); void cleanUpQtVersions(); + + void qtVersionsUpdated(const QString &qmakeCommand); }; class QtOptionsPage : public Core::IOptionsPage diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 37069c06632..f25eedc9def 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -381,6 +381,7 @@ void QtVersionManager::updateQtVersion(int id) if (v->qmakeCommand() == qmakeCommand) v->recheckDumper(); } + emit qtVersionsUpdated(qmakeCommand); } void QtVersionManager::updateSettings() diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index ed7cd8ded1a..5903e96e988 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -118,6 +118,8 @@ public: QString popPendingMwcUpdate(); QString popPendingGcceUpdate(); signals: + // qt version information cache has been invalidated + void qtVersionsUpdated(const QString &qmakeCommand); void qtVersionsChanged(const QList &uniqueIds); void updateExamples(QString, QString, QString);