r25006 by craig - Clean up unnecessary ScrAction initialisers

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 9 21:48:42 UTC 2022


Author: craig
Date: Wed Mar  9 21:48:42 2022
New Revision: 25006

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25006
Log:
Clean up unnecessary ScrAction initialisers

Modified:
    trunk/Scribus/scribus/scraction.cpp
    trunk/Scribus/scribus/scraction.h

Modified: trunk/Scribus/scribus/scraction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25006&path=/trunk/Scribus/scribus/scraction.cpp
==============================================================================
--- trunk/Scribus/scribus/scraction.cpp	(original)
+++ trunk/Scribus/scribus/scraction.cpp	Wed Mar  9 21:48:42 2022
@@ -31,19 +31,16 @@
 
 ScrAction::ScrAction( QObject * parent ) : QAction( parent )
 {
-	initScrAction();
 }
 
 ScrAction::ScrAction(const QString & menuText, const QKeySequence& accel, QObject * parent ) : QAction(menuText, parent)
 {
 	setShortcut(accel);
-	initScrAction();
 }
 
 ScrAction::ScrAction(ActionType aType, const QString & menuText, const QKeySequence& accel, QObject * parent, const QVariant& d) : QAction(menuText, parent)
 {
 	setShortcut(accel);
-	initScrAction();
 	setData(d);
 
 	m_actionType = aType;
@@ -55,7 +52,6 @@
           : QAction(QIcon(icon16), menuText, parent)
 {
 	setShortcut(accel);
-	initScrAction();
 	icon().addPixmap(icon22, QIcon::Normal, QIcon::On);
 
 	m_actionType = aType;
@@ -68,7 +64,6 @@
          : QAction(menuText, parent), m_iconPath16(icon16Path), m_iconPath22(icon22Path)
 {
 	setShortcut(accel);
-	initScrAction();
 	loadIcon();
 
 	m_actionType = aType;
@@ -84,7 +79,6 @@
 {
 	setShortcut(accel);
 	setMenuRole(QAction::NoRole);
-	initScrAction();
 	loadIcon();
 	if (!m_iconPath16.isEmpty() || !m_iconPath22.isEmpty())
 		connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(loadIcon()));
@@ -95,22 +89,10 @@
 	: QAction( QIcon(QPixmap()), "", parent )
 {
 	setShortcut(accel);
-	initScrAction();
 	icon().addPixmap(QPixmap(), QIcon::Normal, QIcon::On);
 	m_actionType = UnicodeChar;
 	setData(d);
 	connect (this, SIGNAL(triggered()), this, SLOT(triggeredToTriggeredData()));
-}
-
-
-void ScrAction::initScrAction()
-{
-	m_actionType = ScrAction::Normal;
-	m_menuIndex = -1;
-	m_popupMenuAddedTo = nullptr;
-	m_savedKeySequence = QKeySequence("");
-	m_shortcutSaved = false;
-	m_fakeToggle = false;
 }
 
 void ScrAction::triggeredToTriggeredData()

Modified: trunk/Scribus/scribus/scraction.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25006&path=/trunk/Scribus/scribus/scraction.h
==============================================================================
--- trunk/Scribus/scribus/scraction.h	(original)
+++ trunk/Scribus/scribus/scraction.h	Wed Mar  9 21:48:42 2022
@@ -45,7 +45,7 @@
 		\brief Constructor from QAction, sets menuType to Normal
 		\param parent Parent object of this action
 	*/
-	ScrAction (QObject *parent) ;
+	ScrAction (QObject *parent);
 		
 	/*!
 		\author Craig Bradney
@@ -187,12 +187,12 @@
 	void triggeredUnicodeShortcut(int);
 	
 protected:
-	int m_menuIndex;
-	ActionType m_actionType;
-	QMenu *m_popupMenuAddedTo;
+	int m_menuIndex {-1};
+	ActionType m_actionType {ScrAction::Normal};
+	QMenu *m_popupMenuAddedTo {nullptr};
 	QKeySequence m_savedKeySequence;
-	bool m_shortcutSaved;
-	bool m_fakeToggle;
+	bool m_shortcutSaved {false};
+	bool m_fakeToggle {false};
 
 	QString m_iconPath16;
 	QString m_iconPath22;




More information about the scribus-commit mailing list