r22902 by jghali - Refactor MenuManager::clearMenuStrings()

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 17 18:54:55 UTC 2019


Author: jghali
Date: Sun Mar 17 18:54:55 2019
New Revision: 22902

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22902
Log:
Refactor MenuManager::clearMenuStrings()

Modified:
    trunk/Scribus/scribus/menumanager.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22902&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp	(original)
+++ trunk/Scribus/scribus/menumanager.cpp	Sun Mar 17 18:54:55 2019
@@ -216,16 +216,10 @@
 
 void MenuManager::clearMenuStrings(const QString &menuName)
 {
-	if (rememberedMenus.contains(menuName))
-	{
-		if (rememberedMenus.value(menuName)!=nullptr)
-		{
-			rememberedMenus.value(menuName)->clear();
-		}
-	}
-}
-
-
+	QMenu* menu = rememberedMenus.value(menuName, nullptr);
+	if (menu != nullptr)
+		menu->clear();
+}
 
 bool MenuManager::addMenuToWidgetOfAction(const QString &menuName, ScrAction *action)
 {




More information about the scribus-commit mailing list