r24835 by jghali - More fixes for Qt6

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 29 21:34:08 UTC 2022


Author: jghali
Date: Sat Jan 29 21:34:08 2022
New Revision: 24835

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24835
Log:
More fixes for Qt6

Modified:
    trunk/Scribus/scribus/desaxe/saxiohelper.cpp
    trunk/Scribus/scribus/desaxe/saxiohelper.h
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/util_ghostscript.cpp

Modified: trunk/Scribus/scribus/desaxe/saxiohelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24835&path=/trunk/Scribus/scribus/desaxe/saxiohelper.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/saxiohelper.cpp	(original)
+++ trunk/Scribus/scribus/desaxe/saxiohelper.cpp	Sat Jan 29 21:34:08 2022
@@ -160,21 +160,6 @@
 	return result;
 }
 
-Xml_string toXMLString(const QVector<double>& doublelist)
-{
-	QString result;
-	for (auto dax = doublelist.cbegin(); dax != doublelist.cend(); ++dax)
-		result += toXMLString(*dax) + " ";
-	return result;
-}
-
-Xml_string toXMLString(const QVector<float>& floatlist)
-{
-	QString result;
-	for (auto dax = floatlist.cbegin(); dax != floatlist.cend(); ++dax)
-		result += toXMLString(*dax) + " ";
-	return result;
-}
 
 QVector<double> parseDoubleVector(const Xml_string& str)
 {
@@ -204,14 +189,6 @@
 	return result;
 }
 
-Xml_string toXMLString(const QVector<int>& intlist)
-{
-	QString result;
-	for (auto dax = intlist.cbegin(); dax != intlist.cend(); ++dax)
-		result += toXMLString(*dax) + " ";
-	return result;
-}
-
 
 QVector<int> parseIntVector(const Xml_string& str)
 {

Modified: trunk/Scribus/scribus/desaxe/saxiohelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24835&path=/trunk/Scribus/scribus/desaxe/saxiohelper.h
==============================================================================
--- trunk/Scribus/scribus/desaxe/saxiohelper.h	(original)
+++ trunk/Scribus/scribus/desaxe/saxiohelper.h	Sat Jan 29 21:34:08 2022
@@ -32,9 +32,6 @@
 Xml_string toXMLString(const QList<double>& doublelist);
 Xml_string toXMLString(const QList<float>& floatlist);
 Xml_string toXMLString(const QList<int>& intlist);
-Xml_string toXMLString(const QVector<double>& doublelist);
-Xml_string toXMLString(const QVector<float>& floatlist);
-Xml_string toXMLString(const QVector<int>& intlist);
 Xml_string toXMLString(const QStringList& list);
 
 unsigned int parseUInt(const Xml_string& str);

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24835&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp	Sat Jan 29 21:34:08 2022
@@ -16,6 +16,7 @@
 #include <QList>
 #include <QMenu>
 #include <QMessageBox>
+#include <QRegularExpression>
 #include <QResizeEvent>
 #include <QSignalBlocker>
 #include <QSignalMapper>
@@ -1379,6 +1380,7 @@
 void OutlinePalette::filterTree(const QString& keyword)
 {
 	OutlineTreeItem *item = nullptr;
+	QRegularExpression regExp(keyword, QRegularExpression::CaseInsensitiveOption);
 	QTreeWidgetItemIterator it( reportDisplay );
 	while (*it)
 	{
@@ -1387,7 +1389,7 @@
 		{
 			if ((item->type == 1) || (item->type == 3) || (item->type == 4))
 			{
-				if (item->PageItemObject->itemName().contains(QRegExp(keyword, Qt::CaseInsensitive)))
+				if (item->PageItemObject->itemName().contains(regExp))
 					item->setHidden(false);
 				else
 					item->setHidden(true);

Modified: trunk/Scribus/scribus/util_ghostscript.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24835&path=/trunk/Scribus/scribus/util_ghostscript.cpp
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.cpp	(original)
+++ trunk/Scribus/scribus/util_ghostscript.cpp	Sat Jan 29 21:34:08 2022
@@ -29,6 +29,7 @@
 #include <QDir>
 #include <QFile>
 #include <QFileInfo>
+#include <QMultiMap>
 #include <QPainter>
 #include <QPixmap>
 #include <QProcess>
@@ -300,16 +301,16 @@
 	if (procArchWow64) isWindows64 = true;
 
 	// Search for Ghostsscript executable in native registry
-	QMap<int, QString> gsVersions;
-	gsVersions.unite( getGSExePaths("SOFTWARE\\GPL Ghostscript") );
-	gsVersions.unite( getGSExePaths("SOFTWARE\\AFPL Ghostscript") );
+	QMultiMap<int, QString> gsVersions;
+	gsVersions.unite( QMultiMap(getGSExePaths("SOFTWARE\\GPL Ghostscript")) );
+	gsVersions.unite( QMultiMap(getGSExePaths("SOFTWARE\\AFPL Ghostscript")) );
 
 	// If running on Windows 64bit, search alternate registry view,
 	// ie 32bit registry if process is 64bit, 64bit registry if process is 32bit
 	if (isWindows64)
 	{
-		gsVersions.unite( getGSExePaths("SOFTWARE\\GPL Ghostscript", true) );
-		gsVersions.unite( getGSExePaths("SOFTWARE\\AFPL Ghostscript", true) );
+		gsVersions.unite( QMultiMap(getGSExePaths("SOFTWARE\\GPL Ghostscript", true)) );
+		gsVersions.unite( QMultiMap(getGSExePaths("SOFTWARE\\AFPL Ghostscript", true)) );
 	}
 
 	if (gsVersions.isEmpty())
@@ -317,8 +318,8 @@
 
 	int currentVer = 0;
 	QString gsPath;
-	QMap<int, QString>::ConstIterator it, itEnd = gsVersions.constEnd();
-	for (it = gsVersions.constBegin(); it != itEnd; ++it)
+	QMultiMap<int, QString>::ConstIterator itEnd = gsVersions.constEnd();
+	for (auto it = gsVersions.constBegin(); it != itEnd; ++it)
 	{
 		int version = it.key();
 		if (version > currentVer)




More information about the scribus-commit mailing list