diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 93c8015f3e3..0b525f65430 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -130,9 +130,10 @@ enum HostBinaries { Designer, Linguist, Uic, QScxmlc }; class BaseQtVersionPrivate { public: - BaseQtVersionPrivate(BaseQtVersion *parent) : q(parent) {} + BaseQtVersionPrivate(BaseQtVersion *parent) + : q(parent) + {} - void setupQmakePathAndId(const FilePath &path); void updateVersionInfo(); QString findHostBinary(HostBinaries binary) const; @@ -300,13 +301,6 @@ BaseQtVersion::~BaseQtVersion() delete d; } -void BaseQtVersionPrivate::setupQmakePathAndId(const FilePath &qmakeCommand) -{ - m_id = QtVersionManager::getUniqueId(); - QTC_CHECK(m_qmakeCommand.isEmpty()); // Should only be used once. - m_qmakeCommand = qmakeCommand; -} - QString BaseQtVersion::defaultUnexpandedDisplayName() const { QString location; @@ -2213,7 +2207,12 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath if (!factory->m_restrictionChecker || factory->m_restrictionChecker(setup)) { BaseQtVersion *ver = factory->create(); QTC_ASSERT(ver, continue); - ver->d->setupQmakePathAndId(qmakePath); + ver->d->m_id = QtVersionManager::getUniqueId(); + QTC_CHECK(ver->d->m_qmakeCommand.isEmpty()); // Should only be used once. + ver->d->m_qmakeCommand = qmakePath; + ver->d->m_unexpandedDisplayName = BaseQtVersion::defaultUnexpandedDisplayName(qmakePath, + false); + ver->d->m_autodetectionSource = autoDetectionSource; ver->d->m_isAutodetected = isAutoDetected; ver->updateDefaultDisplayName(); diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 65695bfff00..bc451f163e8 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -35,8 +35,9 @@ class QTSUPPORT_EXPORT QtVersionManager : public QObject Q_OBJECT // for getUniqueId(); friend class BaseQtVersion; - friend class Internal::BaseQtVersionPrivate; + friend class QtVersionFactory; friend class Internal::QtOptionsPageWidget; + public: static QtVersionManager *instance(); QtVersionManager();