r23888 by jghali - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Mon Jun 15 21:38:58 UTC 2020


Author: jghali
Date: Mon Jun 15 21:38:58 2020
New Revision: 23888

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23888
Log:
Code cleanup

Modified:
    trunk/Scribus/scribus/ui/alignselect.h
    trunk/Scribus/scribus/ui/directionselect.cpp
    trunk/Scribus/scribus/ui/directionselect.h
    trunk/Scribus/scribus/ui/propertiespalette_image.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp
    trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp

Modified: trunk/Scribus/scribus/ui/alignselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/alignselect.h
==============================================================================
--- trunk/Scribus/scribus/ui/alignselect.h	(original)
+++ trunk/Scribus/scribus/ui/alignselect.h	Mon Jun 15 21:38:58 2020
@@ -27,8 +27,6 @@
 	void setStyle(int s, int d);
 	int getStyle();
 	int selectedId();
-	
-	virtual void changeEvent(QEvent *e);
 
 	QButtonGroup* buttonGroup;
 	int selected;
@@ -43,12 +41,13 @@
 	void languageChange();
 	void setTypeStyle(int a);
 
-signals:
-	void State(int);
-
 protected:
 	QHBoxLayout* GroupAlignLayout;
 
+	void changeEvent(QEvent *e) override;
+
+signals:
+	void State(int);
 };
 
 #endif

Modified: trunk/Scribus/scribus/ui/directionselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/directionselect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/directionselect.cpp	(original)
+++ trunk/Scribus/scribus/ui/directionselect.cpp	Mon Jun 15 21:38:58 2020
@@ -77,7 +77,9 @@
 	if (e->type() == QEvent::LanguageChange)
 	{
 		languageChange();
+		return;
 	}
+	QWidget::changeEvent(e);
 }
 
 void DirectionSelect::iconSetChange()

Modified: trunk/Scribus/scribus/ui/directionselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/directionselect.h
==============================================================================
--- trunk/Scribus/scribus/ui/directionselect.h	(original)
+++ trunk/Scribus/scribus/ui/directionselect.h	Mon Jun 15 21:38:58 2020
@@ -29,26 +29,25 @@
     int getStyle();
     int selectedId();
 
-    virtual void changeEvent(QEvent *e);
-
     QButtonGroup* buttonGroup;
     int selected;
     QToolButton* RTL;
     QToolButton* LTR;
 
-
 public slots:
 	void iconSetChange();
     void languageChange();
+
+protected:
+    QHBoxLayout* GroupSelectLayout;
+
+    void changeEvent(QEvent *e) override;
 
 private slots:
     void setTypeStyle(int a);
 
 signals:
     void State(int);
-
-protected:
-    QHBoxLayout* GroupSelectLayout;
 };
 
 #endif // DIRECTIONSELECT_H

Modified: trunk/Scribus/scribus/ui/propertiespalette_image.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/propertiespalette_image.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_image.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_image.cpp	Mon Jun 15 21:38:58 2020
@@ -837,16 +837,14 @@
 	if (!m_doc)
 		return;
 
+	QSignalBlocker imageXOffsetSpinBoxBlocker(imageXOffsetSpinBox);
+	QSignalBlocker imageYOffsetSpinBoxBlocker(imageYOffsetSpinBox);
+
 	m_unitRatio = m_doc->unitRatio();
 	m_unitIndex = m_doc->unitIndex();
 
-	imageXOffsetSpinBox->blockSignals(true);
-	imageXOffsetSpinBox->setNewUnit( m_unitIndex );
-	imageXOffsetSpinBox->blockSignals(false);
-
-	imageYOffsetSpinBox->blockSignals(true);
-	imageYOffsetSpinBox->setNewUnit( m_unitIndex );
-	imageYOffsetSpinBox->blockSignals(false);
+	imageXOffsetSpinBox->setNewUnit(m_unitIndex);
+	imageYOffsetSpinBox->setNewUnit(m_unitIndex);
 }
 
 void PropertiesPalette_Image::localeChange()

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp	Mon Jun 15 21:38:58 2020
@@ -465,26 +465,20 @@
 	if (!m_doc)
 		return;
 
+	QSignalBlocker columnGapBlocker(columnGap);
+	QSignalBlocker leftDistanceBlocker(leftDistance);
+	QSignalBlocker topDistanceBlocker(topDistance);
+	QSignalBlocker bottomDistanceBlocker(bottomDistance);
+	QSignalBlocker rightDistanceBlocker(rightDistance);
+
 	m_unitRatio = m_doc->unitRatio();
 	m_unitIndex = m_doc->unitIndex();
 
-	columnGap->blockSignals(true);
-	leftDistance->blockSignals(true);
-	topDistance->blockSignals(true);
-	bottomDistance->blockSignals(true);
-	rightDistance->blockSignals(true);
-
-	columnGap->setNewUnit( m_unitIndex );
-	leftDistance->setNewUnit( m_unitIndex );
-	topDistance->setNewUnit( m_unitIndex );
-	bottomDistance->setNewUnit( m_unitIndex );
-	rightDistance->setNewUnit( m_unitIndex );
-
-	columnGap->blockSignals(false);
-	leftDistance->blockSignals(false);
-	topDistance->blockSignals(false);
-	bottomDistance->blockSignals(false);
-	rightDistance->blockSignals(false);
+	columnGap->setNewUnit(m_unitIndex);
+	leftDistance->setNewUnit(m_unitIndex);
+	topDistance->setNewUnit(m_unitIndex);
+	bottomDistance->setNewUnit(m_unitIndex);
+	rightDistance->setNewUnit(m_unitIndex);
 }
 
 void PropertyWidget_Distance::localeChange()

Modified: trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23888&path=/trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pathtext.cpp	Mon Jun 15 21:38:58 2020
@@ -246,11 +246,14 @@
 	if (!m_doc)
 		return;
 
+	QSignalBlocker startOffsetBlocker(startOffset);
+	QSignalBlocker distFromCurveBlocker(distFromCurve);
+
 	m_unitRatio = m_doc->unitRatio();
 	m_unitIndex = m_doc->unitIndex();
 
-	startOffset->setNewUnit( m_unitIndex );
-	distFromCurve->setNewUnit( m_unitIndex );
+	startOffset->setNewUnit(m_unitIndex);
+	distFromCurve->setNewUnit(m_unitIndex);
 }
 
 void PropertyWidget_PathText::localeChange()




More information about the scribus-commit mailing list