From 24767dfb0de8b46f79fc69d3d2d3ee95c159206a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 4 Apr 2024 14:09:58 +0200 Subject: [PATCH] Examples: Fix which category gets two columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was giving the first category _alphabetically_ two columns. Which was correct a while ago, but since we have a separate category order defined, it should give the first category in that order two columns instead. Fixes: QTCREATORBUG-30634 Change-Id: Ie89c84f31617a9f90fe18b66bcea352ae3ea56d5 Reviewed-by: Kai Köhne --- src/plugins/qtsupport/examplesparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index 678a3a3139d..a335773b3ef 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -373,9 +373,9 @@ QList>> getCategories(const QList< // order "known" categories as wanted, others come afterwards const int defaultIndex = defaultOrder.indexOf(it->first); const int priority = defaultIndex >= 0 ? defaultIndex : (index + defaultOrderSize); - const std::optional maxRows = restrictRows - ? std::make_optional(index == 0 ? 2 : 1) - : std::nullopt; + const std::optional maxRows = restrictRows ? std::make_optional( + defaultIndex == 0 ? 2 : 1) + : std::nullopt; categories.append({{it->first, priority, maxRows}, it->second}); ++index; }