forked from qt-creator/qt-creator
Utils: Add sorted() function
For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -537,9 +537,7 @@ QtVersions QtVersionManager::versions(const QtVersion::Predicate &predicate)
|
||||
|
||||
QtVersions QtVersionManager::sortVersions(const QtVersions &input)
|
||||
{
|
||||
QtVersions result = input;
|
||||
Utils::sort(result, qtVersionNumberCompare);
|
||||
return result;
|
||||
return Utils::sorted(input, qtVersionNumberCompare);
|
||||
}
|
||||
|
||||
QtVersion *QtVersionManager::version(int id)
|
||||
@@ -566,8 +564,7 @@ void QtVersionManager::setNewQtVersions(const QtVersions &newVersions)
|
||||
{
|
||||
// We want to preserve the same order as in the settings dialog
|
||||
// so we sort a copy
|
||||
QtVersions sortedNewVersions = newVersions;
|
||||
Utils::sort(sortedNewVersions, &QtVersion::uniqueId);
|
||||
const QtVersions sortedNewVersions = Utils::sorted(newVersions, &QtVersion::uniqueId);
|
||||
|
||||
QtVersions addedVersions;
|
||||
QtVersions removedVersions;
|
||||
|
||||
Reference in New Issue
Block a user