r22901 by jghali - Refactor ShapePlugin::addToMainWindowMenu()

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 17 18:50:29 UTC 2019


Author: jghali
Date: Sun Mar 17 18:50:29 2019
New Revision: 22901

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22901
Log:
Refactor ShapePlugin::addToMainWindowMenu()

Modified:
    trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp

Modified: trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22901&path=/trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp	Sun Mar 17 18:50:29 2019
@@ -66,18 +66,18 @@
 
 void ShapePlugin::addToMainWindowMenu(ScribusMainWindow* mw)
 {
-	if (sc_palette)
-	{
-		sc_palette->setMainWindow(mw);
-		languageChange();
-		m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
-		m_actions["shapeShowPalette"]->setToggleAction(true);
-		m_actions["shapeShowPalette"]->setChecked(false);
-		connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(setPaletteShown(bool)));
-		connect(sc_palette, SIGNAL(paletteShown(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
-		mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", "toolsInline", "Windows");
-		mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
-	}
+	if (!sc_palette)
+		return;
+
+	sc_palette->setMainWindow(mw);
+	languageChange();
+	m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
+	m_actions["shapeShowPalette"]->setToggleAction(true);
+	m_actions["shapeShowPalette"]->setChecked(false);
+	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(setPaletteShown(bool)));
+	connect(sc_palette, SIGNAL(paletteShown(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+	mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", "toolsInline", "Windows");
+	mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
 }
 
 const QString ShapePlugin::fullTrName() const




More information about the scribus-commit mailing list