r22001 by jghali - modernize a bit loadsaveplugin.cpp code

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 23 12:48:34 UTC 2017


Author: jghali
Date: Sun Apr 23 12:48:34 2017
New Revision: 22001

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22001
Log:
modernize a bit loadsaveplugin.cpp code

Modified:
    trunk/Scribus/scribus/loadsaveplugin.cpp

Modified: trunk/Scribus/scribus/loadsaveplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22001&path=/trunk/Scribus/scribus/loadsaveplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.cpp	(original)
+++ trunk/Scribus/scribus/loadsaveplugin.cpp	Sun Apr 23 12:48:34 2017
@@ -82,21 +82,21 @@
 	// highest priority entry for each ID, and we can start with the first entry
 	// in the list.
 	//First, check if we even have any plugins to load with
-	if (it!=itEnd)
-	{
-		if (((*it).load) && ((*it).colorReading))
-			filterList.append((*it).fileExtensions);
-		unsigned int lastID = (*it).formatId;
+	if (it != itEnd)
+	{
+		if ((it->load) && (it->colorReading))
+			filterList.append(it->fileExtensions);
+		unsigned int lastID = it->formatId;
 		++it;
-		for ( ; it != itEnd ; ++it )
+		for ( ; it != itEnd ; ++it)
 		{
 			// Find the next load/save (as appropriate) plugin for the next format type
-			if ((((*it).load) && ((*it).colorReading)) && ((*it).formatId > lastID))
+			if (((it->load) && (it->colorReading)) && (it->formatId > lastID))
 			{
 				// And add it to the filter list, since we know it's 
 				// the highest priority because of the sort order.
-				filterList.append((*it).fileExtensions);
-				lastID = (*it).formatId;
+				filterList.append(it->fileExtensions);
+				lastID = it->formatId;
 			}
 		}
 	}
@@ -118,21 +118,21 @@
 	// highest priority entry for each ID, and we can start with the first entry
 	// in the list.
 	//First, check if we even have any plugins to load with
-	if (it!=itEnd)
-	{
-		if ((*it).load)
-			filterList.append((*it).fileExtensions);
-		unsigned int lastID = (*it).formatId;
+	if (it != itEnd)
+	{
+		if (it->load)
+			filterList.append(it->fileExtensions);
+		unsigned int lastID = it->formatId;
 		++it;
-		for ( ; it != itEnd ; ++it )
+		for ( ; it != itEnd ; ++it)
 		{
 			// Find the next load/save (as appropriate) plugin for the next format type
-			if (((*it).load) && ((*it).formatId > lastID))
+			if ((it->load) && (it->formatId > lastID))
 			{
 				// And add it to the filter list, since we know it's 
 				// the highest priority because of the sort order.
-				filterList.append((*it).fileExtensions);
-				lastID = (*it).formatId;
+				filterList.append(it->fileExtensions);
+				lastID = it->formatId;
 			}
 		}
 	}
@@ -154,21 +154,21 @@
 	// highest priority entry for each ID, and we can start with the first entry
 	// in the list.
 	//First, check if we even have any plugins to load with
-	if (it!=itEnd)
-	{
-		if (((*it).load) && ((*it).thumb))
-			filterList.append((*it).fileExtensions);
-		unsigned int lastID = (*it).formatId;
+	if (it != itEnd)
+	{
+		if ((it->load) && (it->thumb))
+			filterList.append(it->fileExtensions);
+		unsigned int lastID = it->formatId;
 		++it;
-		for ( ; it != itEnd ; ++it )
+		for ( ; it != itEnd ; ++it)
 		{
 			// Find the next load/save (as appropriate) plugin for the next format type
-			if ((((*it).load) && ((*it).thumb)) && ((*it).formatId > lastID))
+			if (((it->load) && (it->thumb)) && (it->formatId > lastID))
 			{
 				// And add it to the filter list, since we know it's 
 				// the highest priority because of the sort order.
-				filterList.append((*it).fileExtensions);
-				lastID = (*it).formatId;
+				filterList.append(it->fileExtensions);
+				lastID = it->formatId;
 			}
 		}
 	}
@@ -190,26 +190,26 @@
 	// highest priority entry for each ID, and we can start with the first entry
 	// in the list.
 	//First, check if we even have any plugins to load with
-	if (it==itEnd)
+	if (it == itEnd)
 	{
 		qDebug("%s", tr("No File Loader Plugins Found").toLocal8Bit().data());
 		return filterList;
 	}
 	unsigned int lastID = 0;
 	QStringList scribusList;
-	while (it!=itEnd)
+	while (it != itEnd)
 	{
 		// Find the next load/save (as appropriate) plugin for the next format type
-		if ( (forLoad ? (*it).load : (*it).save) && ((*it).formatId > lastID) )
+		if ((forLoad ? it->load : it->save) && (it->formatId > lastID))
 		{
 			// And add it to the filter list, since we know it's
 			// the highest priority because of the sort order.
 			// #11294, sort them and keep Scribus ones at the top
-			if((*it).nativeScribus)
-				scribusList.append((*it).filter);
+			if(it->nativeScribus)
+				scribusList.append(it->filter);
 			else
-				filterList.append((*it).filter);
-			lastID = (*it).formatId;
+				filterList.append(it->filter);
+			lastID = it->formatId;
 		}
 		++it;
 	}
@@ -304,7 +304,7 @@
 			id = FORMATID_FIRSTUSER - 1;
 			while (it != itEnd)
 			{
-				id = qMax((*it).formatId, id);
+				id = qMax(it->formatId, id);
 				++it;
 			}
 			id++;
@@ -321,8 +321,8 @@
 		QList<FileFormat>::iterator itEnd(formats.end());
 		while (it != itEnd)
 		{
-			if ( ( ((*it).formatId == fmt.formatId) && ((*it).priority <= fmt.priority) ) ||
-				((*it).formatId > fmt.formatId)) 
+			if ( ( (it->formatId == fmt.formatId) && (it->priority <= fmt.priority) ) ||
+				(it->formatId > fmt.formatId)) 
 					break;
 			++it;
 		}
@@ -338,9 +338,9 @@
 	qDebug("Current format list:");
 	QList<FileFormat>::const_iterator it(formats.constBegin());
 	QList<FileFormat>::const_iterator itEnd(formats.constEnd());
-	for ( ; it != itEnd ; ++it )
-	{
-		qDebug("    Format: Id: %3u, Prio: %3hu, Name: %s",  (*it).formatId, (*it).priority, (*it).trName.toLocal8Bit().data() );
+	for ( ; it != itEnd ; ++it)
+	{
+		qDebug("    Format: Id: %3u, Prio: %3hu, Name: %s",  it->formatId, it->priority, it->trName.toLocal8Bit().data() );
 	}
 	qDebug("Done");
 }
@@ -357,7 +357,7 @@
 	QList<FileFormat>::iterator it(formats.begin());
 	while (it != formats.end())
 	{
-		if ((*it).plug == this)
+		if (it->plug == this)
 			it = formats.erase(it);
 		else
 			++it;
@@ -368,9 +368,9 @@
 LoadSavePlugin::findFormat(unsigned int id, LoadSavePlugin* plug, QList<FileFormat>::iterator it)
 {
 	QList<FileFormat>::iterator itEnd(formats.end());
-	for ( ; it != itEnd ; ++it )
-	{
-		if (((*it).formatId == id) && ((plug == 0) || (plug == (*it).plug)))
+	for ( ; it != itEnd ; ++it)
+	{
+		if ((it->formatId == id) && ((plug == 0) || (plug == it->plug)))
 			return it;
 	}
 	return itEnd;
@@ -380,9 +380,9 @@
 LoadSavePlugin::findFormat(const QString& extension, LoadSavePlugin* plug, QList<FileFormat>::iterator it)
 {
 	QList<FileFormat>::iterator itEnd(formats.end());
-	for ( ; it != itEnd ; ++it )
-	{
-		if (((*it).fileExtensions.contains(extension.toLower())) && ((plug == 0) || (plug == (*it).plug)) )
+	for ( ; it != itEnd ; ++it)
+	{
+		if ((it->fileExtensions.contains(extension.toLower())) && ((plug == 0) || (plug == it->plug)) )
 			return it;
 	}
 	return itEnd;




More information about the scribus-commit mailing list