From 85cdc9b402dde73ea6d963b8295eadf84fda2f69 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Wed, 26 Aug 2009 15:42:24 +0200 Subject: [PATCH] Show the "real" name of the default version in build settings. Reviewed-by: dt --- src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp | 9 ++++++--- src/plugins/qt4projectmanager/qt4projectconfigwidget.h | 2 +- src/plugins/qt4projectmanager/qtoptionspage.cpp | 2 +- src/plugins/qt4projectmanager/qtversionmanager.cpp | 4 ++-- src/plugins/qt4projectmanager/qtversionmanager.h | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp index 3d9fcc427ad..faeaca02991 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp @@ -125,6 +125,8 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project) connect(vm, SIGNAL(qtVersionsChanged()), this, SLOT(setupQtVersionsComboBox())); + connect(vm, SIGNAL(qtVersionsChanged()), + this, SLOT(updateDetails())); } Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget() @@ -143,7 +145,7 @@ void Qt4ProjectConfigWidget::updateDetails() QtVersion *version = m_pro->qtVersion(m_buildConfiguration); QString versionString; if (m_pro->qtVersionId(m_buildConfiguration) == 0) { - versionString = tr("Default Qt Version"); + versionString = tr("Default Qt Version (%1)").arg(version->name()); } else { versionString = version->name(); } @@ -202,15 +204,16 @@ void Qt4ProjectConfigWidget::setupQtVersionsComboBox() disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString))); + QtVersionManager *vm = QtVersionManager::instance(); + m_ui->qtVersionComboBox->clear(); - m_ui->qtVersionComboBox->addItem(tr("Default Qt Version"), 0); + m_ui->qtVersionComboBox->addItem(tr("Default Qt Version (%1)").arg(vm->defaultVersion()->name()), 0); if (m_pro->qtVersionId(m_buildConfiguration) == 0) { m_ui->qtVersionComboBox->setCurrentIndex(0); m_ui->invalidQtWarningLabel->setVisible(false); } // Add Qt Versions to the combo box - QtVersionManager *vm = QtVersionManager::instance(); const QList<QtVersion *> &versions = vm->versions(); for (int i = 0; i < versions.size(); ++i) { m_ui->qtVersionComboBox->addItem(versions.at(i)->name(), versions.at(i)->uniqueId()); diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.h b/src/plugins/qt4projectmanager/qt4projectconfigwidget.h index 076c6595173..026827cf4fe 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.h +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.h @@ -64,12 +64,12 @@ private slots: void manageQtVersions(); void selectToolChain(int index); void toggleDetails(); + void updateDetails(); private: void updateToolChainCombo(); void updateImportLabel(); void setToolChain(int index); - void updateDetails(); Ui::Qt4ProjectConfigWidget *m_ui; QAbstractButton *m_browseButton; Qt4Project *m_pro; diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp index f466fc8ad3e..47bc6668469 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.cpp +++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp @@ -76,7 +76,7 @@ QString QtOptionsPage::trCategory() const QWidget *QtOptionsPage::createPage(QWidget *parent) { QtVersionManager *vm = QtVersionManager::instance(); - m_widget = new QtOptionsPageWidget(parent, vm->versions(), vm->currentQtVersion()); + m_widget = new QtOptionsPageWidget(parent, vm->versions(), vm->defaultVersion()); return m_widget; } diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index edb77179b2a..d9fc7ad0c12 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -174,7 +174,7 @@ void QtVersionManager::updateDocumentation() void QtVersionManager::updateExamples() { QList<QtVersion *> versions; - versions.append(currentQtVersion()); + versions.append(defaultVersion()); versions.append(m_versions); QString examplesPath; @@ -334,7 +334,7 @@ void QtVersionManager::updateSystemVersion() ++m_defaultVersion; } -QtVersion *QtVersionManager::currentQtVersion() const +QtVersion *QtVersionManager::defaultVersion() const { if (m_defaultVersion < m_versions.count()) return m_versions.at(m_defaultVersion); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index e3386f5e32a..0dcc1fcb611 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -188,7 +188,7 @@ public: QList<QtVersion *> versions() const; QtVersion *version(int id) const; - QtVersion *currentQtVersion() const; + QtVersion *defaultVersion() const; QtVersion *qtVersionForDirectory(const QString &directory); // Used by the projectloadwizard -- GitLab