{"thread":{"id":"19714","subject":"[PATCH QGit 3/4] Avoid submenus with merely 1 entry","startedAt":"2009-06-06T11:57:50Z","lastAt":"2009-06-06T11:57:50Z","messageCount":1,"participants":["Markus Heidelberg"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"115643","messageId":"1244289471-698-4-git-send-email-markus.heidelberg@web.de","threadId":"19714","inReplyTo":null,"subject":"[PATCH QGit 3/4] Avoid submenus with merely 1 entry","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-06-06T11:57:50Z","receivedAt":"2009-06-06T11:57:50Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Display the branch/tag in the main context menu in these cases, where\nonly the last branch/tag would go into a submenu.\n\nSigned-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n---\n src/mainimpl.cpp |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/src/mainimpl.cpp b/src/mainimpl.cpp\nindex 24b4ef1..38bbfbe 100644\n--- a/src/mainimpl.cpp\n+++ b/src/mainimpl.cpp\n@@ -1197,7 +1197,8 @@ void MainImpl::doContexPopup(SCRef sha) {\n \t\t\tcontextMenu.addSeparator();\n \n \t\tFOREACH_SL (it, bn) {\n-\t\t\tif (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES)\n+\t\t\tif (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES\n+\t\t\t\t\t|| (*it == bn.last() && contextSubMenu.isEmpty() && tn.empty()))\n \t\t\t\tact = contextMenu.addAction(*it);\n \t\t\telse\n \t\t\t\tact = contextSubMenu.addAction(*it);\n@@ -1211,7 +1212,8 @@ void MainImpl::doContexPopup(SCRef sha) {\n \t\t\t\tcontextMenu.addSeparator();\n \n \t\tFOREACH_SL (it, tn) {\n-\t\t\tif (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES)\n+\t\t\tif (cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES\n+\t\t\t\t\t|| (*it == tn.last() && contextSubMenu.isEmpty()))\n \t\t\t\tact = contextMenu.addAction(*it);\n \t\t\telse\n \t\t\t\tact = contextSubMenu.addAction(*it);\n-- \n1.6.3.2.213.g30b07\n"}]}