aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/exampleslistmodel.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-01-21 16:06:36 +0100
committerhjk <hjk@qt.io>2022-01-24 12:13:19 +0000
commit25f5771aa44404877f0d5877cf1d16fd37f84b73 (patch)
tree5496a502f15df7d25724c58ceab82af5f76fb7c4 /src/plugins/qtsupport/exampleslistmodel.cpp
parent6cec0e203315bd2357893c92eef93375a890eb3c (diff)
Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid conflicts. Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/exampleslistmodel.cpp')
-rw-r--r--src/plugins/qtsupport/exampleslistmodel.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp
index f13ae02829..695d48e4ae 100644
--- a/src/plugins/qtsupport/exampleslistmodel.cpp
+++ b/src/plugins/qtsupport/exampleslistmodel.cpp
@@ -119,7 +119,7 @@ ExampleSetModel::ExampleSetModel()
&ExampleSetModel::helpManagerInitialized);
}
-void ExampleSetModel::recreateModel(const QList<BaseQtVersion *> &qtVersions)
+void ExampleSetModel::recreateModel(const QList<QtVersion *> &qtVersions)
{
beginResetModel();
clear();
@@ -137,7 +137,7 @@ void ExampleSetModel::recreateModel(const QList<BaseQtVersion *> &qtVersions)
extraManifestDirs.insert(set.manifestPath);
}
- foreach (BaseQtVersion *version, qtVersions) {
+ foreach (QtVersion *version, qtVersions) {
// sanitize away qt versions that have already been added through extra sets
if (extraManifestDirs.contains(version->docsPath().toString())) {
if (debugExamples()) {
@@ -156,7 +156,7 @@ void ExampleSetModel::recreateModel(const QList<BaseQtVersion *> &qtVersions)
endResetModel();
}
-int ExampleSetModel::indexForQtVersion(BaseQtVersion *qtVersion) const
+int ExampleSetModel::indexForQtVersion(QtVersion *qtVersion) const
{
// return either the entry with the same QtId, or an extra example set with same path
@@ -525,12 +525,12 @@ QPixmap ExamplesListModel::fetchPixmapAndUpdatePixmapCache(const QString &url) c
void ExampleSetModel::updateQtVersionList()
{
- QList<BaseQtVersion *> versions = QtVersionManager::sortVersions(QtVersionManager::versions(
- [](const BaseQtVersion *v) { return v->hasExamples() || v->hasDemos(); }));
+ QList<QtVersion *> versions = QtVersionManager::sortVersions(QtVersionManager::versions(
+ [](const QtVersion *v) { return v->hasExamples() || v->hasDemos(); }));
// prioritize default qt version
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();
- BaseQtVersion *defaultVersion = QtKitAspect::qtVersion(defaultKit);
+ QtVersion *defaultVersion = QtKitAspect::qtVersion(defaultKit);
if (defaultVersion && versions.contains(defaultVersion))
versions.move(versions.indexOf(defaultVersion), 0);
@@ -544,13 +544,13 @@ void ExampleSetModel::updateQtVersionList()
if (currentType == ExampleSetModel::InvalidExampleSet) {
// select examples corresponding to 'highest' Qt version
- BaseQtVersion *highestQt = findHighestQtVersion(versions);
+ QtVersion *highestQt = findHighestQtVersion(versions);
currentIndex = indexForQtVersion(highestQt);
} else if (currentType == ExampleSetModel::QtExampleSet) {
// try to select the previously selected Qt version, or
// select examples corresponding to 'highest' Qt version
int currentQtId = getQtId(currentIndex);
- BaseQtVersion *newQtVersion = QtVersionManager::version(currentQtId);
+ QtVersion *newQtVersion = QtVersionManager::version(currentQtId);
if (!newQtVersion)
newQtVersion = findHighestQtVersion(versions);
currentIndex = indexForQtVersion(newQtVersion);
@@ -559,10 +559,10 @@ void ExampleSetModel::updateQtVersionList()
emit selectedExampleSetChanged(currentIndex);
}
-BaseQtVersion *ExampleSetModel::findHighestQtVersion(const QList<BaseQtVersion *> &versions) const
+QtVersion *ExampleSetModel::findHighestQtVersion(const QList<QtVersion *> &versions) const
{
- BaseQtVersion *newVersion = nullptr;
- for (BaseQtVersion *version : versions) {
+ QtVersion *newVersion = nullptr;
+ for (QtVersion *version : versions) {
if (!newVersion) {
newVersion = version;
} else {
@@ -601,7 +601,7 @@ QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QStrin
demosPath = exampleSet.examplesPath;
} else if (currentType == ExampleSetModel::QtExampleSet) {
int qtId = getQtId(m_selectedExampleSetIndex);
- foreach (BaseQtVersion *version, QtVersionManager::versions()) {
+ foreach (QtVersion *version, QtVersionManager::versions()) {
if (version->uniqueId() == qtId) {
manifestScanPath = version->docsPath().toString();
examplesPath = version->examplesPath().toString();
@@ -660,7 +660,7 @@ void ExampleSetModel::selectExampleSet(int index)
m_selectedExampleSetIndex = index;
writeCurrentIdToSettings(m_selectedExampleSetIndex);
if (getType(m_selectedExampleSetIndex) == ExampleSetModel::QtExampleSet) {
- BaseQtVersion *selectedQtVersion = QtVersionManager::version(getQtId(m_selectedExampleSetIndex));
+ QtVersion *selectedQtVersion = QtVersionManager::version(getQtId(m_selectedExampleSetIndex));
m_selectedQtTypes = selectedQtVersion->targetDeviceTypes();
}
emit selectedExampleSetChanged(m_selectedExampleSetIndex);