diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 67333f75229..418bc9b8c07 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -478,7 +478,7 @@ void KitDetectorPrivate::undoAutoDetect() const } }; for (BaseQtVersion *qtVersion : QtVersionManager::versions()) { - if (qtVersion->autodetectionSource() == m_sharedId) { + if (qtVersion->detectionSource() == m_sharedId) { emit q->logOutput(tr("Removing Qt version: %1").arg(qtVersion->displayName())); QtVersionManager::removeVersion(qtVersion); } diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index b82e0e5783e..8b34f3c5b98 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -78,7 +78,7 @@ namespace QtSupport { namespace Internal { const char QTVERSIONAUTODETECTED[] = "isAutodetected"; -const char QTVERSIONAUTODETECTIONSOURCE[] = "autodetectionSource"; +const char QTVERSIONDETECTIONSOURCE[] = "autodetectionSource"; const char QTVERSION_OVERRIDE_FEATURES[] = "overrideFeatures"; const char QTVERSIONQMAKEPATH[] = "QMakePath"; const char QTVERSIONSOURCEPATH[] = "SourcePath"; @@ -223,7 +223,7 @@ public: bool m_versionInfoUpToDate = false; bool m_qmakeIsExecutable = true; - QString m_autodetectionSource; + QString m_detectionSource; QSet m_overrideFeatures; FilePath m_mkspec; @@ -368,7 +368,7 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const } while (!dir.isRoot() && dir.cdUp()); } - return autodetectionSource() == "PATH" ? + return detectionSource() == "PATH" ? QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} in PATH (%2)").arg(location) : QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} (%2)").arg(location); } @@ -724,7 +724,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map) d->m_id = QtVersionManager::getUniqueId(); d->m_data.unexpandedDisplayName.fromMap(map, Constants::QTVERSIONNAME); d->m_isAutodetected = map.value(QTVERSIONAUTODETECTED).toBool(); - d->m_autodetectionSource = map.value(QTVERSIONAUTODETECTIONSOURCE).toString(); + d->m_detectionSource = map.value(QTVERSIONDETECTIONSOURCE).toString(); d->m_overrideFeatures = Utils::Id::fromStringList(map.value(QTVERSION_OVERRIDE_FEATURES).toStringList()); d->m_qmakeCommand = FilePath::fromVariant(map.value(QTVERSIONQMAKEPATH)); @@ -765,7 +765,7 @@ QVariantMap BaseQtVersion::toMap() const d->m_data.unexpandedDisplayName.toMap(result, Constants::QTVERSIONNAME); result.insert(QTVERSIONAUTODETECTED, isAutodetected()); - result.insert(QTVERSIONAUTODETECTIONSOURCE, autodetectionSource()); + result.insert(QTVERSIONDETECTIONSOURCE, detectionSource()); if (!d->m_overrideFeatures.isEmpty()) result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures)); @@ -885,9 +885,9 @@ bool BaseQtVersion::isAutodetected() const return d->m_isAutodetected; } -QString BaseQtVersion::autodetectionSource() const +QString BaseQtVersion::detectionSource() const { - return d->m_autodetectionSource; + return d->m_detectionSource; } QString BaseQtVersion::displayName() const @@ -2316,7 +2316,7 @@ void BaseQtVersion::resetCache() const static QList g_qtVersionFactories; BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath - (const FilePath &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error) + (const FilePath &qmakePath, bool isAutoDetected, const QString &detectionSource, QString *error) { QHash versionInfo; const Environment env = qmakePath.deviceEnvironment(); @@ -2353,7 +2353,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath 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_autodetectionSource = autoDetectionSource; + ver->d->m_detectionSource = detectionSource; ver->d->m_isAutodetected = isAutoDetected; ver->updateDefaultDisplayName(); ProFileCacheManager::instance()->decRefCount(); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index b722b2fcb86..53e1f98c1c8 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -98,7 +98,7 @@ public: virtual bool equals(BaseQtVersion *other); bool isAutodetected() const; - QString autodetectionSource() const; + QString detectionSource() const; QString displayName() const; QString unexpandedDisplayName() const; diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index b66efe72bfd..f7614bdb2ef 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -184,7 +184,7 @@ void QtKitAspect::setup(Kit *k) const QList &candidates = !exactMatches.empty() ? exactMatches : matches; BaseQtVersion * const qtFromPath = QtVersionManager::version( - equal(&BaseQtVersion::autodetectionSource, QString::fromLatin1("PATH"))); + equal(&BaseQtVersion::detectionSource, QString::fromLatin1("PATH"))); if (qtFromPath && candidates.contains(qtFromPath)) k->setValue(id(), qtFromPath->uniqueId()); else @@ -343,7 +343,7 @@ int QtKitAspect::qtVersionId(const Kit *k) id = -1; } else { QString source = data.toString(); - BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->autodetectionSource() == source; }); + BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->detectionSource() == source; }); if (v) id = v->uniqueId(); } diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index 9f055ea1cc9..d3d48d78058 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -51,10 +51,10 @@ public: /// the desktop factory claims to handle all paths int priority() const { return m_priority; } - static BaseQtVersion *createQtVersionFromQMakePath( - const Utils::FilePath &qmakePath, bool isAutoDetected = false, - const QString &autoDetectionSource = QString(), QString *error = nullptr); - + static BaseQtVersion *createQtVersionFromQMakePath(const Utils::FilePath &qmakePath, + bool isAutoDetected = false, + const QString &detectionSource = {}, + QString *error = nullptr); protected: struct SetupData { diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 7996bebf8bb..8b5c3eefb60 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -265,8 +265,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Existing Qt versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:"<uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } qCDebug(log)<< "======= Adding sdk versions ======="; @@ -303,7 +303,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) bool restored = false; const VersionMap versionsCopy = m_versions; // m_versions is modified in loop for (BaseQtVersion *v : versionsCopy) { - if (v->autodetectionSource() == autoDetectionSource) { + if (v->detectionSource() == autoDetectionSource) { id = v->uniqueId(); qCDebug(log) << " Qt version found with same autodetection source" << autoDetectionSource << " => Migrating id:" << id; m_versions.remove(id); @@ -341,16 +341,16 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Before removing outdated sdk versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } } const VersionMap versionsCopy = m_versions; // m_versions is modified in loop for (BaseQtVersion *qtVersion : versionsCopy) { - if (qtVersion->autodetectionSource().startsWith("SDK.")) { - if (!sdkVersions.contains(qtVersion->autodetectionSource())) { - qCDebug(log) << " removing version"<autodetectionSource(); + if (qtVersion->detectionSource().startsWith("SDK.")) { + if (!sdkVersions.contains(qtVersion->detectionSource())) { + qCDebug(log) << " removing version" << qtVersion->detectionSource(); m_versions.remove(qtVersion->uniqueId()); removed << qtVersion->uniqueId(); } @@ -360,8 +360,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log)<< "======= End result ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:" << version->uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } }