Commit ee92e82c authored by dt's avatar dt
Browse files

Fix bug with importanting a build with an not yet existing qt.

parent 26aca40a
...@@ -358,6 +358,7 @@ bool Qt4Project::restoreSettingsImpl(PersistentSettingsReader &settingsReader) ...@@ -358,6 +358,7 @@ bool Qt4Project::restoreSettingsImpl(PersistentSettingsReader &settingsReader)
// Ensure that the qt version and tool chain in each build configuration is valid // Ensure that the qt version and tool chain in each build configuration is valid
// or if not, is reset to the default // or if not, is reset to the default
foreach (BuildConfiguration *bc, buildConfigurations()) { foreach (BuildConfiguration *bc, buildConfigurations()) {
qtVersionId(bc); qtVersionId(bc);
toolChainType(bc); toolChainType(bc);
......
...@@ -145,7 +145,7 @@ QString Qt4ProjectConfigWidget::displayName() const ...@@ -145,7 +145,7 @@ QString Qt4ProjectConfigWidget::displayName() const
void Qt4ProjectConfigWidget::init(const QString &buildConfiguration) void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
{ {
if (debug) if (debug)
qDebug() << "Qt4ProjectConfigWidget::init()"; qDebug() << "Qt4ProjectConfigWidget::init() for"<<buildConfiguration;
m_buildConfiguration = buildConfiguration; m_buildConfiguration = buildConfiguration;
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfiguration); ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfiguration);
...@@ -183,6 +183,7 @@ void Qt4ProjectConfigWidget::setupQtVersionsComboBox() ...@@ -183,6 +183,7 @@ void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
m_ui->qtVersionComboBox->addItem(tr("Default Qt Version (%1)").arg(vm->defaultVersion()->name()), 0); m_ui->qtVersionComboBox->addItem(tr("Default Qt Version (%1)").arg(vm->defaultVersion()->name()), 0);
int qtVersionId = m_pro->qtVersionId(m_pro->buildConfiguration(m_buildConfiguration)); int qtVersionId = m_pro->qtVersionId(m_pro->buildConfiguration(m_buildConfiguration));
if (qtVersionId == 0) { if (qtVersionId == 0) {
m_ui->qtVersionComboBox->setCurrentIndex(0); m_ui->qtVersionComboBox->setCurrentIndex(0);
m_ui->invalidQtWarningLabel->setVisible(false); m_ui->invalidQtWarningLabel->setVisible(false);
......
...@@ -159,6 +159,7 @@ QtVersionManager *QtVersionManager::instance() ...@@ -159,6 +159,7 @@ QtVersionManager *QtVersionManager::instance()
void QtVersionManager::addVersion(QtVersion *version) void QtVersionManager::addVersion(QtVersion *version)
{ {
m_versions.append(version); m_versions.append(version);
m_uniqueIdToIndex.insert(version->uniqueId(), m_versions.count() - 1);
emit qtVersionsChanged(); emit qtVersionsChanged();
writeVersionsIntoSettings(); writeVersionsIntoSettings();
} }
...@@ -823,6 +824,7 @@ void QtVersion::updateVersionInfo() const ...@@ -823,6 +824,7 @@ void QtVersion::updateVersionInfo() const
{ {
if (m_versionInfoUpToDate) if (m_versionInfoUpToDate)
return; return;
// extract data from qmake executable // extract data from qmake executable
m_versionInfo.clear(); m_versionInfo.clear();
m_notInstalled = false; m_notInstalled = false;
...@@ -937,7 +939,7 @@ void QtVersion::updateMkSpec() const ...@@ -937,7 +939,7 @@ void QtVersion::updateMkSpec() const
mkspecPath = versionInfo().value("QT_INSTALL_DATA") + "/mkspecs/default"; mkspecPath = versionInfo().value("QT_INSTALL_DATA") + "/mkspecs/default";
else else
mkspecPath = mkspecPath + "/default"; mkspecPath = mkspecPath + "/default";
// qDebug() << "default mkspec is located at" << mkspecPath; // qDebug() << "default mkspec is located at" << mkspecPath;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QFile f2(mkspecPath + "/qmake.conf"); QFile f2(mkspecPath + "/qmake.conf");
if (f2.exists() && f2.open(QIODevice::ReadOnly)) { if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
......
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