forked from qt-creator/qt-creator
MiniProjectTargetSelector: Fix wrong sorting
We need to sort indexes based on results. Also fix that with
too tooSmall being true, <= was used instead of <.
Broken in 12103e0f67
Change-Id: Ia8b7484fdea41776050b1a7ef85789cc49deab78
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -780,9 +780,15 @@ QVector<int> MiniProjectTargetSelector::listWidgetWidths(int minSize, int maxSiz
|
||||
if (result[i] != -1)
|
||||
indexes.append(i);
|
||||
|
||||
Utils::sort(indexes, [&](int i, int j) -> bool {
|
||||
return (result[i] > result[j]) ^ tooSmall;
|
||||
});
|
||||
if (tooSmall) {
|
||||
Utils::sort(indexes, [&result](int i, int j) {
|
||||
return result[i] < result[j];
|
||||
});
|
||||
} else {
|
||||
Utils::sort(indexes, [&result](int i, int j) {
|
||||
return result[i] > result[j];
|
||||
});
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int first = result[indexes.first()]; // biggest or smallest
|
||||
|
||||
Reference in New Issue
Block a user