r21942 by craig - Clazy part 8: More multi arg QString replacements, some foreach fixes for references, etc

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 20 21:17:35 UTC 2017


Author: craig
Date: Thu Apr 20 21:17:34 2017
New Revision: 21942

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21942
Log:
Clazy part 8: More multi arg QString replacements, some foreach fixes for references, etc

Modified:
    trunk/Scribus/scribus/cellarea.cpp
    trunk/Scribus/scribus/cellarea.h
    trunk/Scribus/scribus/documentchecker.cpp
    trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
    trunk/Scribus/scribus/fonts/scface_ps.cpp
    trunk/Scribus/scribus/gtgettext.cpp
    trunk/Scribus/scribus/langmgr.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/styles/cellstyle.cpp
    trunk/Scribus/scribus/text/shapedtextfeed.cpp
    trunk/Scribus/scribus/text/shapedtextfeed.h
    trunk/Scribus/scribus/tocgenerator.cpp
    trunk/Scribus/scribus/ui/picstatus.cpp
    trunk/Scribus/scribus/ui/prefs_spelling.cpp
    trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
    trunk/Scribus/scribus/ui/resourcemanager.cpp
    trunk/Scribus/scribus/ui/smcellstyle.cpp
    trunk/Scribus/scribus/ui/smpstylewidget.cpp
    trunk/Scribus/scribus/ui/smradiobutton.cpp
    trunk/Scribus/scribus/ui/smradiobutton.h
    trunk/Scribus/scribus/ui/smtablestyle.cpp
    trunk/Scribus/scribus/undogui.cpp
    trunk/Scribus/scribus/upgradechecker.cpp
    trunk/Scribus/scribus/util_debug.cpp
    trunk/Scribus/scribus/vgradient.cpp

Modified: trunk/Scribus/scribus/cellarea.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/cellarea.cpp
==============================================================================
--- trunk/Scribus/scribus/cellarea.cpp	(original)
+++ trunk/Scribus/scribus/cellarea.cpp	Thu Apr 20 21:17:34 2017
@@ -21,10 +21,10 @@
 {
 }
 
-CellArea::CellArea(const CellArea& other) : m_row(other.m_row), m_column(other.m_column),
-	m_width(other.m_width), m_height(other.m_height)
-{
-}
+//CellArea::CellArea(const CellArea& other) : m_row(other.m_row), m_column(other.m_column),
+//	m_width(other.m_width), m_height(other.m_height)
+//{
+//}
 
 bool CellArea::contains(int row, int column) const
 {

Modified: trunk/Scribus/scribus/cellarea.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/cellarea.h
==============================================================================
--- trunk/Scribus/scribus/cellarea.h	(original)
+++ trunk/Scribus/scribus/cellarea.h	Thu Apr 20 21:17:34 2017
@@ -28,8 +28,9 @@
 	/// Constructs an area starting at @a row, @a column with the given @a width and @a height.
 	CellArea(int row, int column, int width, int height);
 
+	//unneeded
 	/// Constructs an area as a copy of the area @a other.
-	CellArea(const CellArea& other);
+	//CellArea(const CellArea& other);
 
 	/// Returns <code>true</code> if the area is valid.
 	bool isValid() const { return m_width >= 1 && m_height >= 1; }

Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp	(original)
+++ trunk/Scribus/scribus/documentchecker.cpp	Thu Apr 20 21:17:34 2017
@@ -40,12 +40,12 @@
 class MissingGlyphsPainter: public TextLayoutPainter
 {
 	errorCodes& m_itemError;
-	const TextLayout& m_textLayout;
+//	const TextLayout& m_textLayout;
 
 public:
 	MissingGlyphsPainter(errorCodes& itemError, const TextLayout& textLayout)
 		: m_itemError(itemError)
-		, m_textLayout(textLayout)
+//		, m_textLayout(textLayout)
 	{ }
 
 	void drawGlyph(const GlyphCluster& gc)

Modified: trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
==============================================================================
--- trunk/Scribus/scribus/downloadmanager/scdlthread.cpp	(original)
+++ trunk/Scribus/scribus/downloadmanager/scdlthread.cpp	Thu Apr 20 21:17:34 2017
@@ -24,7 +24,7 @@
 
 void ScDLThread::run()
 {
-	emit(runSignal());
+	emit runSignal();
 }
 
 void ScDLThread::addURL(const QUrl &url, bool overwrite, const QString& location, const QString& destinationLocation)

Modified: trunk/Scribus/scribus/fonts/scface_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/fonts/scface_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ps.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface_ps.cpp	Thu Apr 20 21:17:34 2017
@@ -91,13 +91,13 @@
 			metricsFile = fontMetrics.at(i);
 			if (FT_Attach_File(face, metricsFile.toLocal8Bit().constData()))
 			{
-				qDebug() << QObject::tr("Font %1 has broken metrics in file %2, ignoring metrics").arg(fontPath).arg(metricsFile);
+				qDebug() << QObject::tr("Font %1 has broken metrics in file %2, ignoring metrics").arg(fontPath, metricsFile);
 				brokenMetric = true;
 			}
 			else
 			{
 				if (brokenMetric)
-					qDebug() << QObject::tr("Valid metrics were found for font %1, using metrics in file %2").arg(fontFile).arg(metricsFile);
+					qDebug() << QObject::tr("Valid metrics were found for font %1, using metrics in file %2").arg(fontFile, metricsFile);
 				metricsFound = true;
 				break;
 			}

Modified: trunk/Scribus/scribus/gtgettext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/gtgettext.cpp
==============================================================================
--- trunk/Scribus/scribus/gtgettext.cpp	(original)
+++ trunk/Scribus/scribus/gtgettext.cpp	Thu Apr 20 21:17:34 2017
@@ -246,7 +246,7 @@
 	gt2ptr fp_GetText2;
 	sdem fp_GetText;
 	// Initialize Path to the "DLL"
-	QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir()).arg(idata.soFilePath);
+	QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir(), idata.soFilePath);
 	// Attempt to load the plugin, store the pointer in gtplugin
 	gtplugin = PluginManager::loadDLL(pluginFilePath);
 	// If gtplugin is NULL we failed to load the plugin. Report an error to the user and exit the method.
@@ -305,7 +305,7 @@
 	// The actual extensions supported object
 	sdem1 fp_FileExtensions;
 	// Initialise the plugin file path ( with filename )
-	QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir()).arg(name);
+	QString pluginFilePath = QString("%1/gettext/%2").arg(ScPaths::instance().pluginDir(), name);
 	// Attempt to load the plugin.
 	gtplugin = PluginManager::loadDLL(pluginFilePath);
 	// if gtplugin is NULL we were unable to load the plugin. Return an error and exit the method.

Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp	(original)
+++ trunk/Scribus/scribus/langmgr.cpp	Thu Apr 20 21:17:34 2017
@@ -973,8 +973,8 @@
 		dictList.replaceInStrings(".dic","");
 
 		//Ensure we have aff+dic file pairs, remove any hyphenation dictionaries from the list
-		QString dictName;
-		foreach(dictName, dictList)
+
+		foreach(const QString& dictName, dictList)
 		{
 			if (!QFile::exists(dictionaryPaths.at(i)+dictName+".aff"))
 				dictList.removeAll(dictName);
@@ -1051,7 +1051,7 @@
 				dictFilters.append("*.dic");
 		QStringList dictList(dictLocation.entryList(dictFilters, QDir::Files, QDir::Name));
 		dictList.replaceInStrings(".dic","");
-		foreach(QString dn, dictList)
+		foreach(const QString& dn, dictList)
 		{
 //			qDebug()<<dn;
 			QString dictName;

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h	(original)
+++ trunk/Scribus/scribus/pageitem.h	Thu Apr 20 21:17:34 2017
@@ -144,15 +144,7 @@
 // 	Q_ENUMS(PenJoinStyle)
 // 	Q_PROPERTY(PenJoinStyle lineJoin READ lineJoin WRITE setLineJoin DESIGNABLE false)
 
-	// This property may not hang around for too long, but should be useful
-	// when testing out the pageitem refactoring work.  Setting it is unlikely
-	// to currently have the desired effect.
-	/**
-	 * @brief Item type.
-	 * @warning Do not set this property except for testing and debug purposes.
-	 */
-	Q_ENUMS(ItemType)
-	Q_PROPERTY(ItemType itemType READ itemType WRITE convertTo DESIGNABLE false)
+
 
 public:	// Start enumerator definitions
 
@@ -225,6 +217,16 @@
 		Other		= 3
 	};
 		//End enumerator definitions
+
+	// This property may not hang around for too long, but should be useful
+	// when testing out the pageitem refactoring work.  Setting it is unlikely
+	// to currently have the desired effect.
+	/**
+	 * @brief Item type.
+	 * @warning Do not set this property except for testing and debug purposes.
+	 */
+	Q_ENUM(ItemType)
+	Q_PROPERTY(ItemType itemType READ itemType WRITE convertTo DESIGNABLE false)
 
 public: // Start public functions
 

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Thu Apr 20 21:17:34 2017
@@ -5938,7 +5938,7 @@
 			QString ohString  = QString::number(oldHeight * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
 			QString nwString  = QString::number(m_width * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
 			QString nhString  = QString::number(m_height * unitRatio, 'f', unitPrecision) + " " + unitSuffix;
-			QString tooltip   = QString(Um::ResizeFromTo).arg(owString).arg(ohString).arg(nwString).arg(nhString);
+			QString tooltip   = QString(Um::ResizeFromTo).arg(owString, ohString, nwString, nhString);
 			undoTransaction = undoManager->beginTransaction(Um::Selection, Um::ITextFrame, Um::Resize, tooltip, Um::IResize);
 		}
 

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Thu Apr 20 21:17:34 2017
@@ -116,7 +116,7 @@
 {
 	QByteArray m_glyphBuffer;
 	QByteArray m_pathBuffer;
-	PageItem* m_item;
+//	PageItem* m_item;
 	QMap<QString, PdfFont>  m_UsedFontsP;
 	PDFLibCore *m_pdf;
 	uint m_PNr;
@@ -131,7 +131,7 @@
 	PdfPainter(PageItem *ite, PDFLibCore *pdf, uint num, const ScPage* pag) :
 		m_glyphBuffer(),
 		m_pathBuffer(),
-		m_item(ite),
+//		m_item(ite),
 		m_pdf(pdf),
 		m_PNr(num),
 		m_page(pag)
@@ -1073,7 +1073,7 @@
 	{
 		PutDoc("/OpenAction << /S /JavaScript /JS (this."+Pdf::toPdfDocEncoding(Options.openAction)+"\\(\\)) >>\n");
 	}
-	QDateTime dt = QDateTime::currentDateTime().toUTC();
+	QDateTime dt = QDateTime::currentDateTimeUtc();
 	Datum = Pdf::toDateString(dt);
 //    "D:";
 //	tmp.sprintf("%4d", d.year());

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Thu Apr 20 21:17:34 2017
@@ -7255,7 +7255,7 @@
 				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 				QString message = tr("Cannot write the file: \n%1").arg(doc->pdfOptions().fileName);
 				if (!errorMsg.isEmpty())
-					message = QString("%1\n%2").arg(message).arg(errorMsg);
+					message = QString("%1\n%2").arg(message, errorMsg);
 				ScMessageBox::warning(this, CommonStrings::trWarning, message);
 			}
 		}

Modified: trunk/Scribus/scribus/styles/cellstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/styles/cellstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/cellstyle.cpp	(original)
+++ trunk/Scribus/scribus/styles/cellstyle.cpp	Thu Apr 20 21:17:34 2017
@@ -84,12 +84,12 @@
 {
 	QString str("cellstyle(");
 	str += QString("displayName=%1,").arg(displayName());
-	str += QString("fillColor=%1%2,").arg(fillColor()).arg(inh_FillColor ? "(inh)" : "");
+	str += QString("fillColor=%1%2,").arg(fillColor(), inh_FillColor ? "(inh)" : "");
 	str += QString("fillShade=%1%2,").arg(fillShade()).arg(inh_FillShade ? "(inh)" : "");
-	str += QString("leftBorder=%1%2,").arg(leftBorder().asString()).arg(inh_LeftBorder ? "(inh)" : "");
-	str += QString("rightBorder=%1%2,").arg(rightBorder().asString()).arg(inh_RightBorder ? "(inh)" : "");
-	str += QString("topBorder=%1%2,").arg(topBorder().asString()).arg(inh_TopBorder ? "(inh)" : "");
-	str += QString("bottomBorder=%1%2,").arg(bottomBorder().asString()).arg(inh_BottomBorder ? "(inh)" : "");
+	str += QString("leftBorder=%1%2,").arg(leftBorder().asString(), inh_LeftBorder ? "(inh)" : "");
+	str += QString("rightBorder=%1%2,").arg(rightBorder().asString(), inh_RightBorder ? "(inh)" : "");
+	str += QString("topBorder=%1%2,").arg(topBorder().asString(), inh_TopBorder ? "(inh)" : "");
+	str += QString("bottomBorder=%1%2,").arg(bottomBorder().asString(), inh_BottomBorder ? "(inh)" : "");
 	str += QString("leftPadding=%1%2,").arg(leftPadding()).arg(inh_LeftPadding ? "(inh)" : "");
 	str += QString("rightPadding=%1%2,").arg(rightPadding()).arg(inh_RightPadding ? "(inh)" : "");
 	str += QString("topPadding=%1%2,").arg(topPadding()).arg(inh_TopPadding ? "(inh)" : "");

Modified: trunk/Scribus/scribus/text/shapedtextfeed.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/text/shapedtextfeed.cpp
==============================================================================
--- trunk/Scribus/scribus/text/shapedtextfeed.cpp	(original)
+++ trunk/Scribus/scribus/text/shapedtextfeed.cpp	Thu Apr 20 21:17:34 2017
@@ -22,7 +22,7 @@
 
 ShapedTextFeed::ShapedTextFeed(ITextSource* source, int firstChar, ITextContext* context, IShapedTextCache* cache) :
     m_textSource(source),
-    m_context(context),
+//    m_context(context),
 	m_cache(cache),
     m_shaper(context, *source, firstChar),
 	m_endChar(firstChar)

Modified: trunk/Scribus/scribus/text/shapedtextfeed.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/text/shapedtextfeed.h
==============================================================================
--- trunk/Scribus/scribus/text/shapedtextfeed.h	(original)
+++ trunk/Scribus/scribus/text/shapedtextfeed.h	Thu Apr 20 21:17:34 2017
@@ -26,7 +26,7 @@
 class ShapedTextFeed
 {
 	ITextSource* m_textSource;
-	ITextContext* m_context;
+//	ITextContext* m_context;
 	IShapedTextCache* m_cache;
 	TextShaper m_shaper;
 	int m_endChar;

Modified: trunk/Scribus/scribus/tocgenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/tocgenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/tocgenerator.cpp	(original)
+++ trunk/Scribus/scribus/tocgenerator.cpp	Thu Apr 20 21:17:34 2017
@@ -113,7 +113,7 @@
 				//Second is an incremented counter for the item so multiple per page works
 				//Third is the section based page number which is actually used in the TOC.
 				QString tocID = QString("%1").arg(pageCounter[currentDocItem->OwnPage]++, 3 , 10, QChar('0'));
-				QString key   = QString("%1,%2,%3").arg(pageID).arg(tocID).arg(sectionID);
+				QString key = QString("%1,%2,%3").arg(pageID, tocID, sectionID);
 				tocMap.insert(key, objAttr.value);
 			}
 		}

Modified: trunk/Scribus/scribus/ui/picstatus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/picstatus.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/picstatus.cpp	(original)
+++ trunk/Scribus/scribus/ui/picstatus.cpp	Thu Apr 20 21:17:34 2017
@@ -198,7 +198,7 @@
 			sorted.insertMulti(fi.fileName(), item);
 		}
 		int counter = 0;
-		foreach (QString i, sorted.uniqueKeys())
+		foreach (const QString& i, sorted.uniqueKeys())
 		{
 			foreach (PicItem* val, sorted.values(i))
 			{

Modified: trunk/Scribus/scribus/ui/prefs_spelling.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/prefs_spelling.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_spelling.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_spelling.cpp	Thu Apr 20 21:17:34 2017
@@ -94,7 +94,7 @@
 			{
 				//qDebug()<<d.url<<d.files;
 				QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-				foreach (QString s, plainURLs)
+				foreach (const QString& s, plainURLs)
 				{
 					ScQApp->dlManager()->addURL(d.url+"/"+s, true, downloadLocation, userDictDir);
 					++i;

Modified: trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_pareffect.cpp	Thu Apr 20 21:17:34 2017
@@ -124,7 +124,7 @@
 	QStringList numNames;
 	if (m_doc)
 	{
-		foreach (QString numName, m_doc->numerations.keys())
+		foreach (const QString& numName, m_doc->numerations.keys())
 			numNames.append(numName);
 		numNames.sort();
 	}

Modified: trunk/Scribus/scribus/ui/resourcemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/resourcemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.cpp	(original)
+++ trunk/Scribus/scribus/ui/resourcemanager.cpp	Thu Apr 20 21:17:34 2017
@@ -1023,7 +1023,7 @@
 							QDir dir(ScPaths::userFontDir(false));
 							if (!dir.exists(fi.baseName()))
 								dir.mkdir(fi.baseName());
-							foreach (QString f2e, zipFileContents)
+							foreach (const QString& f2e, zipFileContents)
 							{
 								fun->extract(f2e, toDir, ScZipHandler::SkipPaths);
 							}
@@ -1109,7 +1109,7 @@
 								QDir dir(ScPaths::userHelpFilesDir(false));
 								if (!dir.exists(d.lang))
 									dir.mkdir(d.lang);
-								foreach (QString f2e, zipFileContents)
+								foreach (const QString& f2e, zipFileContents)
 								{
 									//qDebug()<<"Unzipping"<<f2e<<"to"<<toDir;
 									fun->extract(f2e, toDir, ScZipHandler::ExtractPaths);
@@ -1222,7 +1222,7 @@
 					if (d.filetype=="zip")
 					{
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 //							qDebug()<<"Requesting:"<<d.url+"/"+s;
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder, d.files);
@@ -1234,7 +1234,7 @@
 					if (d.filetype=="plain")
 					{
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
 							++dlCount;
@@ -1256,7 +1256,7 @@
 					{
 //						qDebug()<<"zip type:"<<d.url<<d.files;
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
 							++dlCount;
@@ -1268,7 +1268,7 @@
 					{
 //						qDebug()<<"plain type:"<<d.url<<d.files;
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
 							++dlCount;
@@ -1289,7 +1289,7 @@
 					{
 //						qDebug()<<"zip type:"<<d.url<<d.files;
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
 							ScQApp->dlManager()->addURL(d.url+"/"+s+".sha256", true, ScPaths::downloadDir(), destinationFolder);
@@ -1311,7 +1311,7 @@
 					{
 //						qDebug()<<"zip type:"<<d.url<<d.files;
 						QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
-						foreach (QString s, plainURLs)
+						foreach (const QString& s, plainURLs)
 						{
 							ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
 							ScQApp->dlManager()->addURL(d.url+"/"+s+".sha256", true, ScPaths::downloadDir(), destinationFolder);
@@ -1387,7 +1387,7 @@
 				case RM_SPELL:
 				case RM_PALETTES:
 */
-			foreach(DownloadItem d, availableList)
+			foreach(const DownloadItem& d, availableList)
 			{
 				if (filesToDownload.contains(d.desc))
 				{

Modified: trunk/Scribus/scribus/ui/smcellstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/smcellstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstyle.cpp	(original)
+++ trunk/Scribus/scribus/ui/smcellstyle.cpp	Thu Apr 20 21:17:34 2017
@@ -118,7 +118,7 @@
 	for (int i = 0; i < m_cachedStyles.count(); ++i)
 		cellStyles << m_cachedStyles[i];
 
-	foreach (QString styleName, styleNames)
+	foreach (const QString& styleName, styleNames)
 	{
 		int index = m_cachedStyles.find(styleName);
 		// FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
@@ -277,7 +277,7 @@
 
 void SMCellStyle::deleteStyles(const QList<RemoveItem> &removeList)
 {
-	foreach (RemoveItem removeItem, removeList)
+	foreach (const RemoveItem& removeItem, removeList)
 	{
 		for (int i = 0; i < m_selection.count(); ++i)
 		{

Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp	Thu Apr 20 21:17:34 2017
@@ -198,7 +198,7 @@
 void SMPStyleWidget::fillNumerationsCombo()
 {
 	QStringList numNames;
-	foreach (QString numName, m_Doc->numerations.keys())
+	foreach (const QString& numName, m_Doc->numerations.keys())
 		numNames.append(numName);
 	numNames.sort();
 	numComboBox->clear();

Modified: trunk/Scribus/scribus/ui/smradiobutton.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/smradiobutton.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smradiobutton.cpp	(original)
+++ trunk/Scribus/scribus/ui/smradiobutton.cpp	Thu Apr 20 21:17:34 2017
@@ -14,16 +14,16 @@
 
 SMRadioButton::SMRadioButton ( QWidget * parent )
 		: QRadioButton ( parent ),
-		hasParent_ ( false ),
-		useParentValue_ ( false ),
-		pValue_ ( false )
+		m_hasParent ( false ),
+		m_useParentValue ( false ),
+		m_pValue ( false )
 {
 }
 
 void SMRadioButton::setChecked(bool val)
 {
-	hasParent_ = false;
-	pValue_ = false;
+	m_hasParent = false;
+	m_pValue = false;
 	setFont(false);
 
 	QRadioButton::setChecked(val);
@@ -31,8 +31,8 @@
 
 void SMRadioButton::setChecked(bool val, bool isParentVal)
 {
-	hasParent_ = true;
-	pValue_ = val;
+	m_hasParent = true;
+	m_pValue = val;
 	setFont(!isParentVal);
 
 	QRadioButton::setChecked(val);
@@ -40,14 +40,14 @@
 
 void SMRadioButton::setParentValue(bool val)
 {
-	hasParent_ = true;
-	pValue_ = val;
+	m_hasParent = true;
+	m_pValue = val;
 }
 
 bool SMRadioButton::useParentValue()
 {
-	bool ret = useParentValue_;
-	useParentValue_ = false;
+	bool ret = m_useParentValue;
+	m_useParentValue = false;
 	return ret;
 }
 

Modified: trunk/Scribus/scribus/ui/smradiobutton.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/smradiobutton.h
==============================================================================
--- trunk/Scribus/scribus/ui/smradiobutton.h	(original)
+++ trunk/Scribus/scribus/ui/smradiobutton.h	Thu Apr 20 21:17:34 2017
@@ -17,9 +17,11 @@
 
 class SMRadioButton : public QRadioButton
 {
+	Q_OBJECT
+
 	public:
 		SMRadioButton(QWidget *parent);
-		~SMRadioButton() {};
+		~SMRadioButton() {}
 
 		void setChecked(bool val);
 		void setChecked(bool val, bool isParentVal);
@@ -29,9 +31,9 @@
 		bool useParentValue();
 
 	private:
-		bool   hasParent_;
-		bool   useParentValue_;
-		bool   pValue_;
+		bool m_hasParent;
+		bool m_useParentValue;
+		bool m_pValue;
 		void setFont(bool wantBold);
 
 };

Modified: trunk/Scribus/scribus/ui/smtablestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/ui/smtablestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestyle.cpp	(original)
+++ trunk/Scribus/scribus/ui/smtablestyle.cpp	Thu Apr 20 21:17:34 2017
@@ -114,7 +114,7 @@
 	for (int i = 0; i < m_cachedStyles.count(); ++i)
 		tableStyles << m_cachedStyles[i];
 
-	foreach (QString styleName, styleNames)
+	foreach (const QString& styleName, styleNames)
 	{
 		int index = m_cachedStyles.find(styleName);
 		// FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
@@ -273,7 +273,7 @@
 
 void SMTableStyle::deleteStyles(const QList<RemoveItem> &removeList)
 {
-	foreach (RemoveItem removeItem, removeList)
+	foreach (const RemoveItem& removeItem, removeList)
 	{
 		for (int i = 0; i < m_selection.count(); ++i)
 		{

Modified: trunk/Scribus/scribus/undogui.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/undogui.cpp
==============================================================================
--- trunk/Scribus/scribus/undogui.cpp	(original)
+++ trunk/Scribus/scribus/undogui.cpp	Thu Apr 20 21:17:34 2017
@@ -143,8 +143,7 @@
 
 void UndoWidget::insertUndoItem(UndoObject* target, UndoState* state)
 {
-	undoItems.insert(undoItems.begin(), QString( tr("%1: %2", "undo target: action (f.e. Text frame: Resize)"))
-                                        .arg(target->getUName()).arg(state->getName()));
+	undoItems.insert(undoItems.begin(), QString( tr("%1: %2", "undo target: action (f.e. Text frame: Resize)")).arg(target->getUName(), state->getName()));
 	clearRedo();
 	updateUndoMenu();
 	updateRedoMenu();
@@ -152,8 +151,7 @@
 
 void UndoWidget::insertRedoItem(UndoObject* target, UndoState* state)
 {
-	redoItems.push_back(QString( tr("%1: %2", "undo target: action (f.e. Text frame: Resize)"))
-                        .arg(target->getUName()).arg(state->getName()));
+	redoItems.push_back(QString( tr("%1: %2", "undo target: action (f.e. Text frame: Resize)")).arg(target->getUName(), state->getName()));
 	updateRedoMenu();
 	updateUndoMenu();
 }
@@ -542,7 +540,7 @@
 		}
 		setIcon(pixmap);
 	}
-	setText(tr("%1 - %2\n%3").arg(targetName).arg(actionName).arg(actionDescription));
+	setText(tr("%1 - %2\n%3").arg(targetName, actionName, actionDescription));
 }
 
 //void UndoPalette::UndoItem::paint(QPainter *painter)

Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp	(original)
+++ trunk/Scribus/scribus/upgradechecker.cpp	Thu Apr 20 21:17:34 2017
@@ -153,7 +153,7 @@
 	QString data(ts.readAll());
 	if ( !doc.setContent( data, &errorMsg, &eline, &ecol )) 
 	{
-		if (data.toLower().contains("404 not found"))
+		if (data.contains("404 not found", Qt::CaseInsensitive))
 			outputText("<b>"+ tr("File not found on server")+"</b>");
 		else
 			outputText("<b>"+ tr("Could not open version file: %1\nError:%2 at line: %3, row: %4").arg(m_file->fileName()).arg(errorMsg).arg(eline).arg(ecol)+"</b>");
@@ -199,12 +199,12 @@
 						}
 						if (newVersion)
 						{
-							QString ver = verA;
-							QString link = e.attribute("link", "");
+							QString ver(verA);
+							QString link(e.attribute("link", ""));
 							if (!link.isEmpty())
 							{
-								QString linkStr = QString("<a href=\"%1\">%2</a>").arg(link).arg(link);
-								ver = QString("%1 : %2").arg(verA).arg(linkStr);
+								QString linkStr = QString("<a href=\"%1\">%2</a>").arg(link, link);
+								ver = QString("%1 : %2").arg(verA, linkStr);
 							}
 							m_updates.append(ver);
 						}

Modified: trunk/Scribus/scribus/util_debug.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/util_debug.cpp
==============================================================================
--- trunk/Scribus/scribus/util_debug.cpp	(original)
+++ trunk/Scribus/scribus/util_debug.cpp	Thu Apr 20 21:17:34 2017
@@ -40,7 +40,7 @@
 void tDebug(QString message)
 {
 	QDateTime debugTime;
-	qDebug("%s", QString("%1\t%2").arg(debugTime.currentDateTime().toString("hh:mm:ss:zzz")).arg(message).toLatin1().constData());
+	qDebug("%s", QString("%1\t%2").arg(debugTime.currentDateTime().toString("hh:mm:ss:zzz"), message).toLatin1().constData());
 }
 
 

Modified: trunk/Scribus/scribus/vgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21942&path=/trunk/Scribus/scribus/vgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradient.cpp	(original)
+++ trunk/Scribus/scribus/vgradient.cpp	Thu Apr 20 21:17:34 2017
@@ -48,7 +48,7 @@
 void VGradient::inSort( VColorStop* d )
 {
 	int index = 0;
-	register VColorStop *n = m_colorStops.value(index);
+	VColorStop *n = m_colorStops.value(index);
 	while (n && compareItems(n,d) <= 0)
 	{
 		++index;




More information about the scribus-commit mailing list