From ece0c7c93747587131d6252b1a705b92470c09e5 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 9 Jul 2014 12:56:30 +0200 Subject: [PATCH] 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 12103e0f676f762658310b885f8d427cdd755a18 Change-Id: Ia8b7484fdea41776050b1a7ef85789cc49deab78 Reviewed-by: Nikita Baryshnikov Reviewed-by: Daniel Teske --- .../projectexplorer/miniprojecttargetselector.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 65f40ff94e0..812fdc737af 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -780,9 +780,15 @@ QVector 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