r23567 by craig - Various code cleanup changes

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 8 20:40:09 UTC 2020


Author: craig
Date: Wed Apr  8 20:40:09 2020
New Revision: 23567

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23567
Log:
Various code cleanup changes

Modified:
    trunk/Scribus/scribus/ui/helpbrowser.h
    trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h
    trunk/Scribus/scribus/ui/prefs_tableofcontents.h
    trunk/Scribus/scribus/ui/scdockpalette.cpp
    trunk/Scribus/scribus/ui/scdockpalette.h
    trunk/Scribus/scribus/ui/sctoolbar.cpp
    trunk/Scribus/scribus/ui/sctoolbar.h
    trunk/Scribus/scribus/ui/splash.cpp

Modified: trunk/Scribus/scribus/ui/helpbrowser.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/helpbrowser.h
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.h	(original)
+++ trunk/Scribus/scribus/ui/helpbrowser.h	Wed Apr  8 20:40:09 2020
@@ -85,7 +85,7 @@
 	void jumpToHelpSection(const QString& jumpToSection, const QString& jumpToFile="", bool dontChangeIfAlreadyLoaded=false);
 
 protected:
-	void closeEvent(QCloseEvent * event);
+	void closeEvent(QCloseEvent * event) override;
 
 	void setupLocalUI();
 	/*! \brief Reads saved bookmarks from external file */

Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h	Wed Apr  8 20:40:09 2020
@@ -32,9 +32,9 @@
 		void restoreDefaults(struct ApplicationPrefs *prefsData) override;
 		void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const override;
 
-		bool event( QEvent* ev );
-		void keyPressEvent(QKeyEvent *k);
-		void keyReleaseEvent(QKeyEvent *k);
+		bool event( QEvent* ev ) override;
+		void keyPressEvent(QKeyEvent *k) override;
+		void keyReleaseEvent(QKeyEvent *k) override;
 
 		static QString getKeyText(const QKeySequence& KeyC);
 		static QString getTrKeyText(const QKeySequence& KeyC);

Modified: trunk/Scribus/scribus/ui/prefs_tableofcontents.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/prefs_tableofcontents.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_tableofcontents.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_tableofcontents.h	Wed Apr  8 20:40:09 2020
@@ -30,7 +30,7 @@
 		void restoreDefaults(struct ApplicationPrefs *prefsData) override;
 		void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const override;
 
-		virtual void changeEvent(QEvent *e);
+		void changeEvent(QEvent *e) override;
 		virtual void enableGUIWidgets();
 
 	public slots:

Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp	Wed Apr  8 20:40:09 2020
@@ -40,12 +40,10 @@
 
 ScDockPalette::ScDockPalette( QWidget * parent, const QString& prefsContext, Qt::WindowFlags f)
 #if defined(Q_OS_MAC) || defined(Q_OS_WIN)
-	: QDockWidget ( parent, f | Qt::Tool  | Qt::CustomizeWindowHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint ),
+	: QDockWidget ( parent, f | Qt::Tool  | Qt::CustomizeWindowHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint )
 #else
-	: QDockWidget ( parent, f | Qt::Tool  | Qt::CustomizeWindowHint ),
+	: QDockWidget ( parent, f | Qt::Tool  | Qt::CustomizeWindowHint )
 #endif
-	m_palettePrefs(nullptr),
-	m_visibleOnStartup(false)
 {
 	if (PrefsManager::instance().appPrefs.uiPrefs.useSmallWidgets)
 	{
@@ -63,7 +61,6 @@
 			  		");
 	}
 	m_originalParent = parent;
-	m_tempParent = nullptr;
 	setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
 	setWindowIcon(IconManager::instance().loadPixmap("AppIcon.png"));
 	setPrefsContext(prefsContext);

Modified: trunk/Scribus/scribus/ui/scdockpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/scdockpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.h	(original)
+++ trunk/Scribus/scribus/ui/scdockpalette.h	Wed Apr  8 20:40:09 2020
@@ -71,10 +71,10 @@
 	/** @brief Stores the geometry of the window when hiding. */
 	virtual void hideEvent(QHideEvent* hideEvent);
 
-	PrefsContext* m_palettePrefs;
+	PrefsContext* m_palettePrefs {nullptr};
 	QString m_prefsContextName;
-	bool m_visibleOnStartup;
-	QWidget* m_originalParent;
-	QWidget* m_tempParent;
+	bool m_visibleOnStartup {false};
+	QWidget* m_originalParent {nullptr};
+	QWidget* m_tempParent {nullptr};
 };
 #endif

Modified: trunk/Scribus/scribus/ui/sctoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/sctoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sctoolbar.cpp	(original)
+++ trunk/Scribus/scribus/ui/sctoolbar.cpp	Wed Apr  8 20:40:09 2020
@@ -39,13 +39,7 @@
 
 ScToolBar::ScToolBar(const QString& name, const QString &prefName, QMainWindow *parent, Qt::Orientation o) : QToolBar(name, parent),
 	m_name(QString("ToolBar-%1").arg(prefName)),
-	floatOrientation(Qt::Horizontal),
-	prefsButton(nullptr),
-	parentMW(parent),
-	dockTop(false),
-	dockRight(false),
-	dockBottom(false),
-	dockLeft(false)
+	parentMW(parent)
 {
 	m_prefs=PrefsManager::instance().prefsFile->getContext(m_name);
 	setObjectName(prefName);

Modified: trunk/Scribus/scribus/ui/sctoolbar.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/sctoolbar.h
==============================================================================
--- trunk/Scribus/scribus/ui/sctoolbar.h	(original)
+++ trunk/Scribus/scribus/ui/sctoolbar.h	Wed Apr  8 20:40:09 2020
@@ -72,14 +72,14 @@
 
 private:
 	QString m_name;
-	PrefsContext *m_prefs;
-	Qt::Orientation floatOrientation;
-	QToolButton *prefsButton;
-	QMainWindow* parentMW;
-	bool dockTop;
-	bool dockRight;
-	bool dockBottom;
-	bool dockLeft;
+	PrefsContext *m_prefs {nullptr};
+	Qt::Orientation floatOrientation {Qt::Horizontal};
+	QToolButton *prefsButton {nullptr};
+	QMainWindow* parentMW {nullptr};
+	bool dockTop {false};
+	bool dockRight {false};
+	bool dockBottom {false};
+	bool dockLeft {false};
 
 // 	void initPrefsButton();
 // 	void storeDockPositions();

Modified: trunk/Scribus/scribus/ui/splash.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23567&path=/trunk/Scribus/scribus/ui/splash.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/splash.cpp	(original)
+++ trunk/Scribus/scribus/ui/splash.cpp	Wed Apr  8 20:40:09 2020
@@ -5,7 +5,6 @@
 for which a new license (GPL+exception) is in place.
 */
 #include <QApplication>
-#include <QDesktopWidget>
 #include <QDebug>
 #include <QMouseEvent>
 #include <QPainter>
@@ -78,8 +77,7 @@
 	if (versionText.contains("svn"))
 	{
 #if defined(HAVE_SVNVERSION) && defined(SVNVERSION)
-		QString revText;
-		revText=QString("SVN Revision: %1").arg(SVNVERSION);
+		QString revText=QString("SVN Revision: %1").arg(SVNVERSION);
 		QRect r2 = rect().adjusted(0, 0, -15, -50);
 		painter->setFont(f);
 		painter->drawText(r2, Qt::AlignRight | Qt::AlignAbsolute | Qt::AlignBottom, revText );




More information about the scribus-commit mailing list