Skip to contentSkip to conversation

Don't count the submenu entries for checking if it is empty

PATCH In review Markus Heidelberg 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Don't count the submenu entries for checking if it is empty

Checking with isEmpty() is more effective.

---
 src/mainimpl.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
src/mainimpl.cpp +3 -3
index 8c7b19e..60414ab 100644
@@ -1179,7 +1179,7 @@ void MainImpl::doContexPopup(SCRef sha) {
 			act = contextRmtMenu.addAction(*it);
 			act->setData("Ref");
 		}
-		if (contextRmtMenu.actions().count() > 0)
+		if (!contextRmtMenu.isEmpty())
 			contextMenu.addMenu(&contextRmtMenu);
 
 		if (!bn.empty())
@@ -1194,7 +1194,7 @@ void MainImpl::doContexPopup(SCRef sha) {
 			act->setData("Ref");
 		}
 		if (!tn.empty())
-			if (contextSubMenu.actions().count() > 0)
+			if (!contextSubMenu.isEmpty())
 				contextSubMenu.addSeparator();
 			else
 				contextMenu.addSeparator();
@@ -1207,7 +1207,7 @@ void MainImpl::doContexPopup(SCRef sha) {
 
 			act->setData("Ref");
 		}
-		if (contextSubMenu.actions().count() > 0)
+		if (!contextSubMenu.isEmpty())
 			contextMenu.addMenu(&contextSubMenu);
 	}
 	contextMenu.exec(QCursor::pos());
Signature · 1 line
1.6.3.2.213.g30b07