summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Öz <aoz@qt.io>2021-08-02 12:59:38 +0200
committerAlp Öz <aoz@qt.io>2021-09-08 16:27:07 +0000
commit4c35c9e057810c9834f1bb610805a697cb74046e (patch)
treeaf07d333b814a787984beb9b5d560cbb2dbbf05e
parent41528390b8b8d7450ca1b812f35e85c9b35d6698 (diff)
downloadqt-creator-4c35c9e057810c9834f1bb610805a697cb74046e.tar.gz
Change sorting in Class View to case insensitive
Change-Id: Ia9ee6726d1d423a127c1e3e57c02ebef8a6f28dd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r--src/plugins/classview/classviewsymbolinformation.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/classview/classviewsymbolinformation.cpp b/src/plugins/classview/classviewsymbolinformation.cpp
index b1bee4be56..ec385d4a70 100644
--- a/src/plugins/classview/classviewsymbolinformation.cpp
+++ b/src/plugins/classview/classviewsymbolinformation.cpp
@@ -123,7 +123,14 @@ bool SymbolInformation::operator<(const SymbolInformation &other) const
return false;
}
- int cmp = name().compare(other.name());
+ // The desired behavior here is to facilitate case insensitive
+ // sorting without generating false case sensitive equalities.
+ // Performance should be appropriate since in C++ there aren't
+ // many symbols that differ by case only.
+
+ int cmp = name().compare(other.name(), Qt::CaseInsensitive);
+ if (cmp == 0)
+ cmp = name().compare(other.name());
if (cmp < 0)
return true;
if (cmp > 0)