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