r22904 by jghali - Remove useless MenuManager::addMenuToWidgetOfAction()

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 17 19:38:46 UTC 2019


Author: jghali
Date: Sun Mar 17 19:38:46 2019
New Revision: 22904

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22904
Log:
Remove useless MenuManager::addMenuToWidgetOfAction()

Modified:
    trunk/Scribus/scribus/menumanager.cpp
    trunk/Scribus/scribus/menumanager.h
    trunk/Scribus/scribus/undogui.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22904&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp	(original)
+++ trunk/Scribus/scribus/menumanager.cpp	Sun Mar 17 19:38:46 2019
@@ -221,38 +221,11 @@
 		menu->clear();
 }
 
-bool MenuManager::addMenuToWidgetOfAction(const QString &menuName, ScrAction *action)
-{
-	bool retVal=false;
-	/*if (menuList.contains(menuName) && menuList[menuName]!=nullptr && action!=nullptr)
-	{
-		 //qt4 cb replace with qwidgetaction or similar
-//		QWidget *w=action->getWidgetAddedTo();
-//		if (w)
-//		{
-//			QString menuItemListClassName=w->className();
-//			if (menuItemListClassName=="QToolButton")
-//			{
-//				QToolButton *toolButton=dynamic_cast<QToolButton *>(w);
-//				if (toolButton!=nullptr)
-//				{
-//					toolButton->setPopup(menuList[menuName]->getLocalPopupMenu());
-//					retVal=true;
-//				}
-//			}
-//		}
-
-	}
-*/
-	return retVal;
-}
-
 void MenuManager::addMenuItemString(const QString& s, const QString &parent)
 {
 	if (menuStrings.contains(parent))
 		menuStrings[parent].append(s);
 }
-
 
 void MenuManager::addMenuItemStringAfter(const QString& s, const QString& after, const QString &parent)
 {

Modified: trunk/Scribus/scribus/menumanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22904&path=/trunk/Scribus/scribus/menumanager.h
==============================================================================
--- trunk/Scribus/scribus/menumanager.h	(original)
+++ trunk/Scribus/scribus/menumanager.h	Sun Mar 17 19:38:46 2019
@@ -49,7 +49,6 @@
 
 		enum MenuType {Normal, DLL};
 
-		bool addMenuToWidgetOfAction(const QString &menuName, ScrAction *action);
 		bool createMenu(const QString &menuName, const QString &menuText = QString::null, const QString& parent = QString::null, bool checkable = false, bool rememberMenu = false);
 		void removeMenuItem(const QString& s, ScrAction *menuAction, const QString &parent);
 		bool removeMenuItem(ScrAction *menuAction, const QString &parent);

Modified: trunk/Scribus/scribus/undogui.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22904&path=/trunk/Scribus/scribus/undogui.cpp
==============================================================================
--- trunk/Scribus/scribus/undogui.cpp	(original)
+++ trunk/Scribus/scribus/undogui.cpp	Sun Mar 17 19:38:46 2019
@@ -52,20 +52,22 @@
 
 UndoWidget::UndoWidget(QWidget* parent, const char* name) : UndoGui(parent, name)
 {
+	auto &actions = ScCore->primaryMainWindow()->scrActions;
+	auto menuManager = ScCore->primaryMainWindow()->scrMenuMgr;
+
 	//Scribus action based toolbar button construction
-	parent->addAction(ScCore->primaryMainWindow()->scrActions["editUndoAction"]);
-	parent->addAction(ScCore->primaryMainWindow()->scrActions["editRedoAction"]);
-	ScCore->primaryMainWindow()->scrMenuMgr->createMenu("undoButtonMenu", "undoButtonMenu");
-	ScCore->primaryMainWindow()->scrMenuMgr->createMenu("redoButtonMenu", "redoButtonMenu");
-	undoMenu=ScCore->primaryMainWindow()->scrMenuMgr->undoMenu();
-	redoMenu=ScCore->primaryMainWindow()->scrMenuMgr->redoMenu();
-	ScCore->primaryMainWindow()->scrMenuMgr->addMenuToWidgetOfAction("undoButtonMenu", ScCore->primaryMainWindow()->scrActions["editUndoAction"]);
-	ScCore->primaryMainWindow()->scrMenuMgr->addMenuToWidgetOfAction("redoButton/*Menu*/", ScCore->primaryMainWindow()->scrActions["editRedoAction"]);
-
-	parent->addAction(ScCore->primaryMainWindow()->scrActions["editCut"]);
-	parent->addAction(ScCore->primaryMainWindow()->scrActions["editCopy"]);
-	parent->addAction(ScCore->primaryMainWindow()->scrActions["editPaste"]);
-	ScCore->primaryMainWindow()->scrMenuMgr->addMenuToWidgetOfAction("EditPasteRecent", ScCore->primaryMainWindow()->scrActions["editPaste"]);
+	parent->addAction(actions["editUndoAction"]);
+	parent->addAction(actions["editRedoAction"]);
+
+	menuManager->createMenu("undoButtonMenu", "undoButtonMenu");
+	menuManager->createMenu("redoButtonMenu", "redoButtonMenu");
+	undoMenu = menuManager->undoMenu();
+	redoMenu = menuManager->redoMenu();
+
+	parent->addAction(actions["editCut"]);
+	parent->addAction(actions["editCopy"]);
+	parent->addAction(actions["editPaste"]);
+
 	connect(undoMenu, SIGNAL(triggered(QAction*)), this, SLOT(undoMenuClicked(QAction*)));
 	connect(redoMenu, SIGNAL(triggered(QAction*)), this, SLOT(redoMenuClicked(QAction*)));
 }




More information about the scribus-commit mailing list