r24917 by craig - Qt6 warning fixes: Change to newer QProcess API

scribus-commit scribus-commit at lists.scribus.net
Sun Feb 6 14:56:30 UTC 2022


Author: craig
Date: Sun Feb  6 14:56:30 2022
New Revision: 24917

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24917
Log:
Qt6 warning fixes: Change to newer QProcess API

Modified:
    trunk/Scribus/scribus/ui/about.cpp
    trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
    trunk/Scribus/scribus/util.cpp
    trunk/Scribus/scribus/util_ghostscript.cpp

Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24917&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp	(original)
+++ trunk/Scribus/scribus/ui/about.cpp	Sun Feb  6 14:56:30 2022
@@ -126,8 +126,8 @@
 	buildID = new QLabel( tab );
 	buildID->setAlignment(Qt::AlignCenter);
 	buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
-	QString BUILD_DAY = "29";
-	QString BUILD_MONTH = CommonStrings::january;
+	QString BUILD_DAY = "6";
+	QString BUILD_MONTH = CommonStrings::february;
 	QString BUILD_YEAR = "2022";
 	QString BUILD_TIME = "";
 	QString BUILD_TZ = "";

Modified: trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24917&path=/trunk/Scribus/scribus/ui/pagepalette_widgets.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_widgets.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_widgets.cpp	Sun Feb  6 14:56:30 2022
@@ -322,23 +322,23 @@
 	if (!e->mimeData()->hasFormat("page/magic"))
 		return;
 	e->acceptProposedAction();
-	int a = rowAt(e->pos().y());
-	int b = columnAt(e->pos().x());
+	int row = rowAt(e->pos().y());
+	int col = columnAt(e->pos().x());
 	clearPix();
-	if ((a == -1) || (b == -1))
+	if ((row == -1) || (col == -1))
 		return;
 	if (columnCount() == 1)
 	{
-		if ((a % 2) == 0)
-		{
-			item(a, 0)->setBackground(Qt::darkBlue);
+		if ((row % 2) == 0)
+		{
+			item(row, 0)->setBackground(Qt::darkBlue);
 		}
 	}
 	else
 	{
-		if (((b % 2) == 0) || (a == rowCount()-1))
-		{
-			item(a, b)->setBackground(Qt::darkBlue);
+		if (((col % 2) == 0) || (row == rowCount()-1))
+		{
+			item(row, col)->setBackground(Qt::darkBlue);
 		}
 	}
 }

Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24917&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp	(original)
+++ trunk/Scribus/scribus/util.cpp	Sun Feb  6 14:56:30 2022
@@ -60,14 +60,17 @@
 	return lang.left(dotIndex);
 }
 
-int System(const QString& exename, const QStringList & args, const QString& fileStdErr, const QString& fileStdOut, const bool* cancel)
+int System(const QString& exename, const QStringList& args, const QString& fileStdErr, const QString& fileStdOut, const bool* cancel)
 {
 	QProcess proc;
 	if (!fileStdOut.isEmpty())
 		proc.setStandardOutputFile(fileStdOut);
 	if (!fileStdErr.isEmpty())
 		proc.setStandardErrorFile(fileStdErr);
-	proc.start(exename, args);
+	QString command(exename);
+	command.append(" ");
+	command.append(args.join(" "));
+	proc.startCommand(command.toLocal8Bit());
 	if (proc.waitForStarted(15000))
 	{
 		while (!proc.waitForFinished(15000))

Modified: trunk/Scribus/scribus/util_ghostscript.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24917&path=/trunk/Scribus/scribus/util_ghostscript.cpp
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.cpp	(original)
+++ trunk/Scribus/scribus/util_ghostscript.cpp	Sun Feb  6 14:56:30 2022
@@ -205,10 +205,8 @@
 
 bool testGSAvailability(const QString& gsPath)
 {
-	QStringList args;
-	args.append( "-h" );
 	QProcess proc;
-	proc.start(getShortPathName(gsPath), args);
+	proc.startCommand(getShortPathName(gsPath) + " -h");
 	if (!proc.waitForStarted(5000))
 		return false;
 	proc.waitForFinished(5000);
@@ -217,13 +215,12 @@
 
 bool testGSDeviceAvailability( const QString& device )
 {
-	QStringList args;
-	PrefsManager& prefsManager = PrefsManager::instance();
-	args.append( QString("-sDEVICE=%1").arg( device ) );
-	args.append( "-c" );
-	args.append( "quit" );
+	QString command(getShortPathName(PrefsManager::instance().ghostscriptExecutable()));
+	command.append(" -sDEVICE=");
+	command.append(device);
+	command.append(" -c quit");
 	QProcess proc;
-	proc.start(getShortPathName(prefsManager.ghostscriptExecutable()), args);
+	proc.startCommand(command.toLocal8Bit());
 	if (!proc.waitForStarted(5000))
 		return false;
 	proc.waitForFinished(5000);
@@ -233,11 +230,10 @@
 // Return the GhostScript version string, or QString() if it couldn't be retrieved.
 QString getGSVersion()
 {
-	QStringList args;
-	args.append(QString("--version").toLocal8Bit());
-	QString gsExe = getShortPathName(PrefsManager::instance().ghostscriptExecutable());
+	QString command(getShortPathName(PrefsManager::instance().ghostscriptExecutable()));
+	command.append(" --version");
 	QProcess proc;
-	proc.start(gsExe.toLocal8Bit(), args);
+	proc.startCommand(command.toLocal8Bit());
 	if (proc.waitForStarted(5000))
 	{
 		while (!proc.waitForFinished(5000))




More information about the scribus-commit mailing list