r24919 by craig - Some string fixes, change the build ID data to be platform related only

scribus-commit scribus-commit at lists.scribus.net
Sun Feb 6 17:12:28 UTC 2022


Author: craig
Date: Sun Feb  6 17:12:28 2022
New Revision: 24919

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24919
Log:
Some string fixes, change the build ID data to be platform related only
as all other older dependencies are now required.

Modified:
    trunk/Scribus/scribus/api/api_application.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/scimagecacheproxy.cpp

Modified: trunk/Scribus/scribus/api/api_application.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24919&path=/trunk/Scribus/scribus/api/api_application.cpp
==============================================================================
--- trunk/Scribus/scribus/api/api_application.cpp	(original)
+++ trunk/Scribus/scribus/api/api_application.cpp	Sun Feb  6 17:12:28 2022
@@ -22,46 +22,34 @@
 	QString getBuildInformation()
 	{
 		QString bu;
-		bu += "C";
-		bu += "-";
-		bu += "-";
-		bu += "T";
-		bu += "-";
-	#ifdef HAVE_FONTCONFIG
-		bu += "F";
-	#else
-		bu += "*";
-	#endif
-		bu += "-";
-		bu += "C";
-		bu += cairo_version_string();
-
-	// Some more information if we are not on a 32bit little endian Unix machine
-	#if defined(Q_OS_WIN)
-		bu += "-Windows";
-	#elif defined(Q_OS_MAC)
-		bu += "-Mac";
-	#elif defined(Q_OS_DARWIN)
+		// Some more information if we are not on a 32bit little endian Unix machine
+#if defined(Q_OS_WIN)
+		bu += QLatin1String("Windows");
+#elif defined(Q_OS_MAC)
+		bu += QLatin1String("Mac");
+#elif defined(Q_OS_DARWIN)
 		// dunno if anyone uses this...
-		bu += "-Darwin";
-	#endif
+		bu += "Darwin";
+#endif
 		if (QSysInfo::WordSize != 32)
 			bu += QString("-%1bit").arg(QSysInfo::WordSize);
-	#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+		bu += QLatin1String("-");
+		bu += QSysInfo::buildCpuArchitecture();
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
 		if (QSysInfo::ByteOrder==QSysInfo::BigEndian)
 			bu += "-Big";
-	#endif
+#endif
 		return bu;
 	}
 
 	QString getVersion()
 	{
-		return QString(VERSION);
+		return QStringLiteral(VERSION);
 	}
 
 	int getVersionMajor()
 	{
-		QRegularExpression version_regex("(\\d+)\\.(\\d+)\\.(\\d+)(.*)");
+		QRegularExpression version_regex(QStringLiteral("(\\d+)\\.(\\d+)\\.(\\d+)(.*)"));
 		QRegularExpressionMatch match = version_regex.match(getVersion());
 		if (!match.hasMatch())
 			return -1;
@@ -70,7 +58,7 @@
 
 	int getVersionMinor()
 	{
-		QRegularExpression version_regex("(\\d+)\\.(\\d+)\\.(\\d+)(.*)");
+		QRegularExpression version_regex(QStringLiteral("(\\d+)\\.(\\d+)\\.(\\d+)(.*)"));
 		QRegularExpressionMatch match = version_regex.match(getVersion());
 		if (!match.hasMatch())
 			return -1;
@@ -79,7 +67,7 @@
 
 	int getVersionPatch()
 	{
-		QRegularExpression version_regex("(\\d+)\\.(\\d+)\\.(\\d+)(.*)");
+		QRegularExpression version_regex(QStringLiteral("(\\d+)\\.(\\d+)\\.(\\d+)(.*)"));
 		QRegularExpressionMatch match = version_regex.match(getVersion());
 		if (!match.hasMatch())
 			return -1;
@@ -88,7 +76,7 @@
 
 	QString getVersionSuffix()
 	{
-		QRegularExpression version_regex("(\\d+)\\.(\\d+)\\.(\\d+)(.*)");
+		QRegularExpression version_regex(QStringLiteral("(\\d+)\\.(\\d+)\\.(\\d+)(.*)"));
 		QRegularExpressionMatch match = version_regex.match(getVersion());
 		if (!match.hasMatch())
 			return QString();
@@ -97,7 +85,7 @@
 
 	QString getVersionScribus()
 	{
-		return QString("Scribus") + " " + getVersion();
+		return QStringLiteral("Scribus") + " " + getVersion();
 	}
 
 	QByteArray getVersionScribusAsByteArray()
@@ -117,7 +105,7 @@
 
 	bool isSVN()
 	{
-		return getVersion().contains("svn", Qt::CaseInsensitive);
+		return getVersion().contains(QLatin1String("svn"), Qt::CaseInsensitive);
 	}
 
 	bool haveSVNRevision()

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24919&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	Sun Feb  6 17:12:28 2022
@@ -113,7 +113,7 @@
 
 bool Scribus13Format::fileSupported(QIODevice* /* file */, const QString & fileName) const
 {
-	QByteArray docBytes("");
+	QByteArray docBytes;
 	if (fileName.right(2) == "gz")
 	{
 		QFile file(fileName);

Modified: trunk/Scribus/scribus/scimagecacheproxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24919&path=/trunk/Scribus/scribus/scimagecacheproxy.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecacheproxy.cpp	(original)
+++ trunk/Scribus/scribus/scimagecacheproxy.cpp	Sun Feb  6 17:12:28 2022
@@ -143,10 +143,10 @@
 
 			if (xml.name() == QLatin1String("cache"))
 			{
-				if (attr.hasAttribute("base"))
+				if (attr.hasAttribute(QLatin1String("base")))
 				{
 					if (base)
-						*base = attr.value("base").toString();
+						*base = attr.value(QLatin1String("base")).toString();
 
 					baseFound = true;
 				}




More information about the scribus-commit mailing list