QtSupport: Rename BaseQtVersion::autodetection* to detection

It's also used for manually triggered detection nowadays and
closer in naming to what kit, debugger and kit have.

Change-Id: I68705aafe297d61afc8b5918650e47353d3ccce1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2021-07-12 16:10:43 +02:00
parent afe95c4ac2
commit 324ff024d7
6 changed files with 27 additions and 27 deletions

View File

@@ -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);
}

View File

@@ -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<Utils::Id> 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<QtVersionFactory *> 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<ProKey, ProString> 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();

View File

@@ -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;

View File

@@ -184,7 +184,7 @@ void QtKitAspect::setup(Kit *k)
const QList<BaseQtVersion *> &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();
}

View File

@@ -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
{

View File

@@ -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:"<<version->uniqueId();
qCDebug(log) << " autodetection source:"<< version->autodetectionSource();
qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:"<<version->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:"<<version->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"<<qtVersion->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) << "";
}
}