QtVersionManager: Remove QtVersionManager::versions(...)

This call used to return a sorted list of BaseQtVersion *, which is
expensive as sorting might imply running qmake for all Qt versions.

This also makes BaseQtVersion::validVersions(...) return an unsorted list,
so go over all usages of validVersions(...) and use
QtVersionManager::sortVersions(...) where that is necessary.

Change-Id: I8f5dda20fc0819134c64f6a1ca32512500f71710
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-12 10:31:44 +01:00
parent 14edd0a0c2
commit 54cf91b45b
5 changed files with 9 additions and 20 deletions

View File

@@ -487,9 +487,10 @@ void ExamplesListModel::updateExamples()
void ExamplesListModel::updateQtVersions()
{
QList<BaseQtVersion*> versions = QtVersionManager::validVersions([](const BaseQtVersion *v) {
QList<BaseQtVersion*> versions
= QtVersionManager::sortVersions(QtVersionManager::validVersions([](const BaseQtVersion *v) {
return v->hasExamples() || v->hasDemos();
});
}));
// prioritize default qt version
ProjectExplorer::Kit *defaultKit = ProjectExplorer::KitManager::defaultKit();