r20042 by craig - Some code cleaning in shortwords

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 30 22:40:18 UTC 2015


Author: craig
Date: Thu Apr 30 22:40:17 2015
New Revision: 20042

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20042
Log:
Some code cleaning in shortwords

Modified:
    trunk/Scribus/scribus/plugins/short-words/configuration.cpp
    trunk/Scribus/scribus/plugins/short-words/parse.cpp

Modified: trunk/Scribus/scribus/plugins/short-words/configuration.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20042&path=/trunk/Scribus/scribus/plugins/short-words/configuration.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/configuration.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/configuration.cpp Thu Apr 30 22:40:17 2015
@@ -53,21 +53,21 @@
 
 QStringList SWConfig::getShortWordsFromFile(QString lang, QString filename)
 {
-	// all shorts for one language
-	QString shorts = "";
-	// one line in cfg. file
-	QString aRow;
-	// cfg (doesn't) exists for the selected language indicator
-	bool success = false;
 	// path to the cfg. file
-	QFile f;
-
-	f.setFileName(filename);
+	QFile f(filename);
 	if (!f.exists())
 	{
 		qDebug("Short Words config file not found");
 		return QStringList();
 	}
+
+	// all shorts for one language
+	QString shorts;
+	// one line in cfg. file
+	QString aRow;
+	// cfg (doesn't) exists for the selected language indicator
+	bool success = false;
+
 	if (f.open(QIODevice::ReadOnly))
 	{
 		QTextStream t(&f);
@@ -163,4 +163,4 @@
 	}
 
 	return languages;
-}
+}

Modified: trunk/Scribus/scribus/plugins/short-words/parse.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20042&path=/trunk/Scribus/scribus/plugins/short-words/parse.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/parse.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/parse.cpp Thu Apr 30 22:40:17 2015
@@ -41,7 +41,7 @@
 void SWParse::parseItem(PageItem *aFrame)
 {
 	// the content of the frame - text itself
-	QString content = QString();
+	QString content;
 	int changes = 0;
 	// list of the short words
 	QStringList shorts;
@@ -57,10 +57,10 @@
 		return;
 
 	// an ugly hack to get the language code from the item language property
-	if (lang.isNull() || lang.isEmpty())
+	if (lang.isEmpty())
 	{
 		lang = aFrame->itemText.charStyle(0).language();
-		if (lang.isNull() || lang.isEmpty())
+		if (lang.isEmpty())
 			qDebug("SWParse::parseItem - variable lang is still empty. No changes are made.");
 	}
 




More information about the scribus-commit mailing list