r22972 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 29 20:59:11 UTC 2019


Author: jghali
Date: Mon Apr 29 20:59:11 2019
New Revision: 22972

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22972
Log:
Refactor SMFontComboH

Modified:
    trunk/Scribus/scribus/ui/smfontcomboh.cpp
    trunk/Scribus/scribus/ui/smfontcomboh.h

Modified: trunk/Scribus/scribus/ui/smfontcomboh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22972&path=/trunk/Scribus/scribus/ui/smfontcomboh.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smfontcomboh.cpp	(original)
+++ trunk/Scribus/scribus/ui/smfontcomboh.cpp	Mon Apr 29 20:59:11 2019
@@ -9,10 +9,10 @@
 
 SMFontComboH::SMFontComboH(QWidget *parent)
 : FontComboH(parent, true),
-  hasParent_(false),
-  useParentValue_(false),
-  pFont_(QString::null),
-  usePFont_( tr("Use Parent Font"))
+  m_hasParent(false),
+  m_useParentValue(false),
+  m_parentFont(QString::null),
+  m_useParentFont( tr("Use Parent Font"))
 {
 	
 }
@@ -22,8 +22,8 @@
 	disconnect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
 	disconnect(fontStyle, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
 	setFont(false);
-	hasParent_ = false;
-	pFont_ = s;
+	m_hasParent = false;
+	m_parentFont = s;
 	FontComboH::setCurrentFont(s);
 }
 
@@ -31,8 +31,8 @@
 {
 	disconnect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
 	disconnect(fontStyle, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
-	hasParent_ = true;
-	pFont_ = s;
+	m_hasParent = true;
+	m_parentFont = s;
 	FontComboH::setCurrentFont(s);
 	setFont(!isParentValue);
 	connect(fontFamily, SIGNAL(highlighted(int)), this, SLOT(currentChanged()));
@@ -41,33 +41,33 @@
 
 void SMFontComboH::setParentFont(const QString &s)
 {
-	hasParent_ = true;
-	pFont_ = s;
+	m_hasParent = true;
+	m_parentFont = s;
 }
 
 bool SMFontComboH::useParentFont()
 {
 	bool ret = false;
 
-	if (useParentValue_ && hasParent_)
+	if (m_useParentValue && m_hasParent)
 	{
-		ret = fontFamily->currentText() == usePFont_ ||
-			  fontStyle->currentText() == usePFont_;
+		ret = fontFamily->currentText() == m_useParentFont ||
+			  fontStyle->currentText() == m_useParentFont;
 
 		if (ret)
 		{
 			bool familySigBlocked = fontFamily->blockSignals(true);
 			bool styleSigBlocked = fontStyle->blockSignals(true);
-			if (fontFamily->itemText(fontFamily->count() - 1) == usePFont_)
+			if (fontFamily->itemText(fontFamily->count() - 1) == m_useParentFont)
 				fontFamily->removeItem(fontFamily->count() - 1);
-			if (fontStyle->itemText(fontStyle->count() - 1) == usePFont_)
+			if (fontStyle->itemText(fontStyle->count() - 1) == m_useParentFont)
 				fontStyle->removeItem(fontStyle->count() - 1);
 			fontFamily->blockSignals(familySigBlocked);
 			fontStyle->blockSignals(styleSigBlocked);
 
 			setFont(false);
-			setCurrentFont(pFont_, true);
-			useParentValue_ = false;
+			setCurrentFont(m_parentFont, true);
+			m_useParentValue = false;
 		}
 	}
 
@@ -84,22 +84,22 @@
 
 void SMFontComboH::currentChanged()
 {
-	if (hasParent_ && !useParentValue_)
+	if (m_hasParent && !m_useParentValue)
 	{
 		setFont(true);
-		fontFamily->addItem(usePFont_);
-		fontStyle->addItem(usePFont_);
-		useParentValue_ = true;
+		fontFamily->addItem(m_useParentFont);
+		fontStyle->addItem(m_useParentFont);
+		m_useParentValue = true;
 	}
-	else if (hasParent_)
+	else if (m_hasParent)
 		checkStyle();
 }
 
 void SMFontComboH::checkStyle()
 {
-	if (hasParent_ && useParentValue_)
+	if (m_hasParent && m_useParentValue)
 	{
-		if (fontStyle->itemText(fontStyle->count() - 1) != usePFont_)
-			fontStyle->addItem(usePFont_);
+		if (fontStyle->itemText(fontStyle->count() - 1) != m_useParentFont)
+			fontStyle->addItem(m_useParentFont);
 	}
 }

Modified: trunk/Scribus/scribus/ui/smfontcomboh.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22972&path=/trunk/Scribus/scribus/ui/smfontcomboh.h
==============================================================================
--- trunk/Scribus/scribus/ui/smfontcomboh.h	(original)
+++ trunk/Scribus/scribus/ui/smfontcomboh.h	Mon Apr 29 20:59:11 2019
@@ -26,10 +26,11 @@
 	bool useParentFont();
 
 private:
-	bool   hasParent_;
-	bool   useParentValue_;
-	QString pFont_;
-	QString usePFont_;
+	bool    m_hasParent;
+	bool    m_useParentValue;
+	QString m_parentFont;
+	QString m_useParentFont;
+
 	void setFont(bool wantBold);
 
 private slots:




More information about the scribus-commit mailing list