r24008 by jghali - Cosmetic changes and code style fixes

scribus-commit scribus-commit at lists.scribus.net
Sat Sep 5 10:05:22 UTC 2020


Author: jghali
Date: Sat Sep  5 10:05:21 2020
New Revision: 24008

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24008
Log:
Cosmetic changes and code style fixes

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

Modified: trunk/Scribus/scribus/iconmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24008&path=/trunk/Scribus/scribus/iconmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/iconmanager.cpp	(original)
+++ trunk/Scribus/scribus/iconmanager.cpp	Sat Sep  5 10:05:21 2020
@@ -63,7 +63,7 @@
 {
 	QString baseIconDir(ScPaths::instance().iconDir());
 	QStringList locations;
-	locations<<baseIconDir;
+	locations << baseIconDir;
 	QStringList configNames;
 	for (QStringList::Iterator it = locations.begin(); it != locations.end(); ++it)
 	{
@@ -174,22 +174,22 @@
 	}
 }
 
-QCursor IconManager::loadCursor(const QString& nam, int hotX, int hotY, bool forceUseColor)
-{
-	return QCursor(loadPixmap(nam, forceUseColor), hotX, hotY);
-}
-
-QIcon IconManager::loadIcon(const QString& nam, bool forceUseColor)
-{
-	return QIcon(loadPixmap(nam, forceUseColor));
-}
-
-QPixmap IconManager::loadPixmap(const QString& nam, bool forceUseColor, bool rtlFlip)
-{
-	if (m_pxCache.contains(nam))
-		return *m_pxCache[nam];
-
-	QString iconFilePath(pathForIcon(nam));
+QCursor IconManager::loadCursor(const QString& name, int hotX, int hotY, bool forceUseColor)
+{
+	return QCursor(loadPixmap(name, forceUseColor), hotX, hotY);
+}
+
+QIcon IconManager::loadIcon(const QString& name, bool forceUseColor)
+{
+	return QIcon(loadPixmap(name, forceUseColor));
+}
+
+QPixmap IconManager::loadPixmap(const QString& name, bool forceUseColor, bool rtlFlip)
+{
+	if (m_pxCache.contains(name))
+		return *m_pxCache[name];
+
+	QString iconFilePath(pathForIcon(name));
 	QPixmap *pm = new QPixmap();
 	pm->load(iconFilePath);
 	if (pm->isNull())
@@ -204,7 +204,7 @@
 		t.rotate(180);
 		*pm = pm->transformed(t);
 	}
-	m_pxCache.insert(nam, pm);
+	m_pxCache.insert(name, pm);
 	return *pm;
 }
 
@@ -252,18 +252,18 @@
 	return name;
 }
 
-QString IconManager::pathForIcon(const QString& nam)
+QString IconManager::pathForIcon(const QString& name)
 {
 	//QString iconset(PrefsManager::instance().appPrefs.uiPrefs.iconSet);
-	QString iconSubdir(m_iconSets[m_activeSetBasename].path+"/");
-	QString primaryIconSubdir(m_iconSets[m_backupSetBasename].path+"/");
-
-	QString iconFilePath(QString("%1%2%3").arg(ScPaths::instance().iconDir(), iconSubdir, nam));
+	QString iconSubdir(m_iconSets[m_activeSetBasename].path + "/");
+	QString primaryIconSubdir(m_iconSets[m_backupSetBasename].path + "/");
+
+	QString iconFilePath(QString("%1%2%3").arg(ScPaths::instance().iconDir(), iconSubdir, name));
 	if (QFile::exists(iconFilePath))
 		return iconFilePath;
 
 	qWarning("pathForIcon: Unable to load icon %s: File not found", iconFilePath.toLatin1().constData());
-	iconFilePath=QString("%1%2%3").arg(ScPaths::instance().iconDir(), primaryIconSubdir, nam);
+	iconFilePath = QString("%1%2%3").arg(ScPaths::instance().iconDir(), primaryIconSubdir, name);
 
 	if (QFile::exists(iconFilePath))
 	{
@@ -273,7 +273,7 @@
 #ifdef WANT_DEBUG
 	qWarning("pathForIcon: Unable to load icon %s: File not found", iconFilePath.toLatin1().constData());
 #endif
-	return "";
+	return QString();
 }
 
 QStringList IconManager::pathList() const

Modified: trunk/Scribus/scribus/iconmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24008&path=/trunk/Scribus/scribus/iconmanager.h
==============================================================================
--- trunk/Scribus/scribus/iconmanager.h	(original)
+++ trunk/Scribus/scribus/iconmanager.h	Sat Sep  5 10:05:21 2020
@@ -48,10 +48,10 @@
 		void clearCache();
 		bool setup();
 
-		QCursor loadCursor(const QString& nam, int hotX = -1, int hotY = -1, bool forceUseColor=false);
-		QIcon loadIcon(const QString& nam, bool forceUseColor=false);
-		QPixmap loadPixmap(const QString& nam, bool forceUseColor=false, bool rtlFlip=false);
-		QString pathForIcon(const QString& nam);
+		QCursor loadCursor(const QString& name, int hotX = -1, int hotY = -1, bool forceUseColor=false);
+		QIcon loadIcon(const QString& name, bool forceUseColor=false);
+		QPixmap loadPixmap(const QString& name, bool forceUseColor=false, bool rtlFlip=false);
+		QString pathForIcon(const QString& name);
 		QStringList pathList() const;
 		QStringList nameList(const QString& language) const;
 		void iconToGrayscale(QPixmap *pm);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24008&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sat Sep  5 10:05:21 2020
@@ -6424,7 +6424,7 @@
 
 	PageItem *currItem = doc->m_Selection->itemAt(0);
 	QTransform itemTrans = currItem->getTransform();
-	double xOffset=0.0,yOffset=0.0;
+	double xOffset = 0.0, yOffset = 0.0;
 	switch (position)
 	{
 		case 1: //top left




More information about the scribus-commit mailing list