forked from qt-creator/qt-creator
BaseQtVersion: Remove setupQmakeAndId method on private object
Inline it into its one user or move the code into the constructor of the object. Change-Id: Iae2882a6d82444b2603d4c98159c8ef95c5dd507 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user