Commit 91259db4 authored by Kai Koehne's avatar Kai Koehne
Browse files

DebuggingHelper: Always invalidate cached QtVersion information after run

Moving this to DebuggingHelperBuildTask / QtVersionManager makes sure
the version information is also updated if e.g. the QtOptionsPage has
been closed in between.

Also, update all Qt versions that share the same qmake path.

Change-Id: Idc23f6d9fa609e2a36f1d6d4cb09c6483afd4cc4
parent e6b58f23
......@@ -35,6 +35,7 @@
#include "qmlobservertool.h"
#include "qmldebugginglibrary.h"
#include <qt4projectmanager/baseqtversion.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/debugginghelper.h>
......@@ -91,6 +92,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()
......
......@@ -591,7 +591,6 @@ void QMakeStepConfigWidget::debuggingHelperBuildFinished(int qtVersionId, const
BaseQtVersion *version = QtVersionManager::instance()->version(qtVersionId);
if (!version) // qt version got deleted in between
return;
version->recheckDumper();
if (version == m_step->qt4BuildConfiguration()->qtVersion()) {
m_ui.qmlDebuggingLibraryCheckBox->setChecked(m_step->linkQmlDebuggingLibrary());
......
......@@ -112,8 +112,6 @@ private slots:
m_failed = true;
errorMessage = QString::fromLatin1("Qt version became invalid");
} else {
version->recheckDumper();
if (!version->hasQmlDump()) {
m_failed = true;
errorMessage = QString::fromLatin1("Could not build QML plugin dumping helper for %1\n"
......
......@@ -246,7 +246,6 @@ void QtOptionsPageWidget::debuggingHelperBuildFinished(int qtVersionId, const QS
return; // Oops, somebody managed to delete the version
BaseQtVersion *version = m_versions.at(index);
version->recheckDumper();
// Update item view
QTreeWidgetItem *item = treeItemForIndex(index);
......
......@@ -370,6 +370,19 @@ void QtVersionManager::updateDocumentation()
helpManager->registerDocumentation(files);
}
void QtVersionManager::updateQtVersion(int id)
{
BaseQtVersion *qtVersion = version(id);
QTC_ASSERT(qtVersion, return);
// update actually all Qt versions with the same qmake command
const QString qmakeCommand = qtVersion->qmakeCommand();
foreach (BaseQtVersion *v, versions()) {
if (v->qmakeCommand() == qmakeCommand)
v->recheckDumper();
}
}
void QtVersionManager::updateSettings()
{
updateDocumentation();
......
......@@ -121,8 +121,12 @@ signals:
void qtVersionsChanged(const QList<int> &uniqueIds);
void updateExamples(QString, QString, QString);
public slots:
void updateQtVersion(int id);
private slots:
void updateSettings();
private:
// This function is really simplistic...
static bool equals(BaseQtVersion *a, BaseQtVersion *b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment