Commit 96c6033d authored by Tobias Hunger's avatar Tobias Hunger

QtVersionManager: Rename QtVersionManager::unsortedVersions(...)

Rename QtVersionManager::unsortedVersions(...) to QtVersionManager::versions(...).

This is what you should use, so make that the obvious choice.

Change-Id: Ice6e195d9aad7968ce87d378323627347b22bc74
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 54cf91b4
......@@ -1266,7 +1266,7 @@ void AndroidConfigurations::updateAutomaticKitList()
QHash<Abi, QList<const QtSupport::BaseQtVersion *> > qtVersionsForArch;
const QList<QtSupport::BaseQtVersion *> qtVersions
= QtSupport::QtVersionManager::unsortedVersions([](const QtSupport::BaseQtVersion *v) {
= QtSupport::QtVersionManager::versions([](const QtSupport::BaseQtVersion *v) {
return v->type() == Constants::ANDROIDQT;
});
for (const QtSupport::BaseQtVersion *qtVersion : qtVersions) {
......
......@@ -337,7 +337,7 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
}
const QList<QtSupport::BaseQtVersion *> androidQts
= QtSupport::QtVersionManager::unsortedVersions([](const QtSupport::BaseQtVersion *v) {
= QtSupport::QtVersionManager::versions([](const QtSupport::BaseQtVersion *v) {
return v->type() == QLatin1String(Constants::ANDROIDQT) && !v->qtAbis().isEmpty();
});
QSet<ProjectExplorer::Abi> qtVersionsForAbi;
......
......@@ -152,7 +152,7 @@ static QHash<Platform, ToolChainPair> findToolChains(const QList<Platform> &plat
static QHash<Abi::Architecture, QSet<BaseQtVersion *>> iosQtVersions()
{
const QList<BaseQtVersion *> iosVersions
= QtVersionManager::unsortedVersions([](const BaseQtVersion *v) {
= QtVersionManager::versions([](const BaseQtVersion *v) {
return v->isValid() && v->type() == Constants::IOSQT;
});
QHash<Abi::Architecture, QSet<BaseQtVersion *>> versions;
......
......@@ -251,7 +251,7 @@ QnxQtVersion* QnxConfiguration::qnxQtVersion(QnxArchitecture arch) const
{
QnxQtVersion *qnxQt;
foreach (BaseQtVersion *version,
QtVersionManager::instance()->unsortedVersions(Utils::equal(&BaseQtVersion::type,
QtVersionManager::instance()->versions(Utils::equal(&BaseQtVersion::type,
QString::fromLatin1(Constants::QNX_QNX_QT)))) {
qnxQt = dynamic_cast<QnxQtVersion*>(version);
if (qnxQt && qnxQt->architecture() == arch) {
......
......@@ -47,7 +47,7 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, const ProjectExplo
m_combo = new QComboBox;
m_combo->addItem(tr("None"), -1);
QList<int> versionIds = Utils::transform(QtVersionManager::unsortedVersions(), &BaseQtVersion::uniqueId);
QList<int> versionIds = Utils::transform(QtVersionManager::versions(), &BaseQtVersion::uniqueId);
versionsChanged(versionIds, QList<int>(), QList<int>());
m_manageButton = new QPushButton(KitConfigWidget::msgManage());
......
......@@ -235,7 +235,7 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent)
m_ui->qtdirList->setTextElideMode(Qt::ElideMiddle);
m_ui->qtdirList->sortByColumn(0, Qt::AscendingOrder);
QList<int> additions = transform(QtVersionManager::unsortedVersions(), &BaseQtVersion::uniqueId);
QList<int> additions = transform(QtVersionManager::versions(), &BaseQtVersion::uniqueId);
updateQtVersions(additions, QList<int>(), QList<int>());
......
......@@ -489,7 +489,7 @@ static void updateDocumentation()
void QtVersionManager::updateDumpFor(const FileName &qmakeCommand)
{
foreach (BaseQtVersion *v, unsortedVersions()) {
foreach (BaseQtVersion *v, versions()) {
if (v->qmakeCommand() == qmakeCommand)
v->recheckDumper();
}
......@@ -501,7 +501,7 @@ int QtVersionManager::getUniqueId()
return m_idcount++;
}
QList<BaseQtVersion *> QtVersionManager::unsortedVersions(const BaseQtVersion::Predicate &predicate)
QList<BaseQtVersion *> QtVersionManager::versions(const BaseQtVersion::Predicate &predicate)
{
QList<BaseQtVersion *> versions;
QTC_ASSERT(isLoaded(), return versions);
......@@ -523,7 +523,7 @@ QList<BaseQtVersion *> QtVersionManager::validVersions(const BaseQtVersion::Pred
QTC_ASSERT(isLoaded(), return { });
auto superPredicate
= [predicate](const BaseQtVersion *v) { return v->isValid() && (!predicate || predicate(v)); };
return unsortedVersions(superPredicate);
return versions(superPredicate);
}
bool QtVersionManager::isValidId(int id)
......
......@@ -49,7 +49,7 @@ public:
// Sorting is slow due to needing to potentially run qmake --query for each version
static QList<BaseQtVersion *> validVersions(const BaseQtVersion::Predicate &predicate = BaseQtVersion::Predicate());
static QList<BaseQtVersion *> unsortedVersions(const BaseQtVersion::Predicate &predicate = BaseQtVersion::Predicate());
static QList<BaseQtVersion *> versions(const BaseQtVersion::Predicate &predicate = BaseQtVersion::Predicate());
// Sorting is potentially expensive since it might require qmake --query to run for each version!
static QList<BaseQtVersion *> sortVersions(const QList<BaseQtVersion *> &input);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment