From a99b6f9f412d758173ec7f7b01223f6068c71d9a Mon Sep 17 00:00:00 2001 From: tetektoza Date: Fri, 5 Sep 2025 01:00:37 +0200 Subject: [PATCH] Gui: Use cleaner variable naming for menu items in SelectionView --- src/Gui/Selection/SelectionView.cpp | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Gui/Selection/SelectionView.cpp b/src/Gui/Selection/SelectionView.cpp index 78c8cfbdd3..b356645db4 100644 --- a/src/Gui/Selection/SelectionView.cpp +++ b/src/Gui/Selection/SelectionView.cpp @@ -791,27 +791,28 @@ void SelectionMenu::buildMenuStructure(std::map &menus } } - for (auto it : menuArray) { - auto &v = *it; - auto &info = v.second; + for (auto elementTypeIterator : menuArray) { + auto &elementTypeEntry = *elementTypeIterator; + auto &subMenuInfo = elementTypeEntry.second; + const std::string &elementType = elementTypeEntry.first; - if (info.items.empty()) { + if (subMenuInfo.items.empty()) { continue; } - info.menu = addMenu(QString::fromUtf8(v.first.c_str())); - bool groupMenu = shouldGroupMenu(info); + subMenuInfo.menu = addMenu(QString::fromUtf8(elementType.c_str())); + bool groupMenu = shouldGroupMenu(subMenuInfo); - for (auto &vv : info.items) { - const std::string &label = vv.first; + for (auto &objectLabelEntry : subMenuInfo.items) { + const std::string &objectLabel = objectLabelEntry.first; - for (auto &vvv : vv.second) { - auto &elementInfo = vvv.second; + for (auto &objectPathEntry : objectLabelEntry.second) { + auto &elementInfo = objectPathEntry.second; if (!groupMenu) { - createFlatMenu(elementInfo, info.menu, label, v.first, selections); + createFlatMenu(elementInfo, subMenuInfo.menu, objectLabel, elementType, selections); } else { - createGroupedMenu(elementInfo, info.menu, label, v.first, selections); + createGroupedMenu(elementInfo, subMenuInfo.menu, objectLabel, elementType, selections); } } } @@ -1028,10 +1029,10 @@ bool SelectionMenu::shouldGroupMenu(const SubMenuInfo &info) std::size_t objCount = 0; std::size_t count = 0; - for (auto &vv : info.items) { - objCount += vv.second.size(); - for (auto &vvv : vv.second) - count += vvv.second.indices.size(); + for (auto &objectLabelEntry : info.items) { + objCount += objectLabelEntry.second.size(); + for (auto &objectPathEntry : objectLabelEntry.second) + count += objectPathEntry.second.indices.size(); if (count > 5 && objCount > 1) { return true; }