forked from qt-creator/qt-creator
QtVersionManager: Only load Qt versions after the toolchains are available
The mingw Qt versions need to know the mingw toolchains to run qmake since that may link to a library provided by mingw. This patch delays loading of the Qt versions till after the Tool Chains are available by explicitly listening to the toolChainsLoaded signal of the Toolchain Manager. I do not see how else we can enforce the proper ordering with the plugin initialization scheme we have. Task-number: QTCREATORBUG-11898 Change-Id: I5a93c2b2b32c658695017295652242a5aaa6ee60 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -96,6 +96,8 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
|
||||
|
||||
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
|
||||
|
||||
QtVersionManager::initialized();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -108,8 +110,6 @@ void QtSupportPlugin::extensionsInitialized()
|
||||
" You probably want %1 instead.").arg(QString::fromLatin1(kHostBins)));
|
||||
connect(VariableManager::instance(), SIGNAL(variableUpdateRequested(QByteArray)),
|
||||
this, SLOT(updateVariable(QByteArray)));
|
||||
|
||||
QtVersionManager::extensionsInitialized();
|
||||
}
|
||||
|
||||
bool QtSupportPlugin::delayedInitialize()
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
|
||||
#include <utils/buildablehelperlibrary.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -159,8 +161,11 @@ QtVersionManager::QtVersionManager()
|
||||
connect(m_fileWatcherTimer, SIGNAL(timeout()), SLOT(updateFromInstaller()));
|
||||
}
|
||||
|
||||
void QtVersionManager::extensionsInitialized()
|
||||
void QtVersionManager::triggerQtVersionRestore()
|
||||
{
|
||||
disconnect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsLoaded()),
|
||||
this, SLOT(triggerQtVersionRestore()));
|
||||
|
||||
bool success = restoreQtVersions();
|
||||
m_instance->updateFromInstaller(false);
|
||||
if (!success) {
|
||||
@@ -202,6 +207,12 @@ QtVersionManager::~QtVersionManager()
|
||||
m_versions.clear();
|
||||
}
|
||||
|
||||
void QtVersionManager::initialized()
|
||||
{
|
||||
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainsLoaded()),
|
||||
QtVersionManager::instance(), SLOT(triggerQtVersionRestore()));
|
||||
}
|
||||
|
||||
QObject *QtVersionManager::instance()
|
||||
{
|
||||
return m_instance;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
static QObject *instance();
|
||||
QtVersionManager();
|
||||
~QtVersionManager();
|
||||
static void extensionsInitialized();
|
||||
static void initialized();
|
||||
static bool delayedInitialize();
|
||||
|
||||
static bool isLoaded();
|
||||
@@ -83,6 +83,7 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void updateFromInstaller(bool emitSignal = true);
|
||||
void triggerQtVersionRestore();
|
||||
|
||||
private:
|
||||
// Used by QtOptionsPage
|
||||
|
||||
Reference in New Issue
Block a user