r24918 by jghali - Qt6: revert broken changes introduced by previous commit

scribus-commit scribus-commit at lists.scribus.net
Sun Feb 6 16:03:48 UTC 2022


Author: jghali
Date: Sun Feb  6 16:03:48 2022
New Revision: 24918

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24918
Log:
Qt6: revert broken changes introduced by previous commit

Modified:
    trunk/Scribus/scribus/util.cpp
    trunk/Scribus/scribus/util_ghostscript.cpp

Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24918&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp	(original)
+++ trunk/Scribus/scribus/util.cpp	Sun Feb  6 16:03:48 2022
@@ -67,10 +67,7 @@
 		proc.setStandardOutputFile(fileStdOut);
 	if (!fileStdErr.isEmpty())
 		proc.setStandardErrorFile(fileStdErr);
-	QString command(exename);
-	command.append(" ");
-	command.append(args.join(" "));
-	proc.startCommand(command.toLocal8Bit());
+	proc.start(exename, args);
 	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=24918&path=/trunk/Scribus/scribus/util_ghostscript.cpp
==============================================================================
--- trunk/Scribus/scribus/util_ghostscript.cpp	(original)
+++ trunk/Scribus/scribus/util_ghostscript.cpp	Sun Feb  6 16:03:48 2022
@@ -205,8 +205,10 @@
 
 bool testGSAvailability(const QString& gsPath)
 {
+	QStringList args;
+	args.append( "-h" );
 	QProcess proc;
-	proc.startCommand(getShortPathName(gsPath) + " -h");
+	proc.start(getShortPathName(gsPath), args);
 	if (!proc.waitForStarted(5000))
 		return false;
 	proc.waitForFinished(5000);
@@ -215,12 +217,13 @@
 
 bool testGSDeviceAvailability( const QString& device )
 {
-	QString command(getShortPathName(PrefsManager::instance().ghostscriptExecutable()));
-	command.append(" -sDEVICE=");
-	command.append(device);
-	command.append(" -c quit");
+	QStringList args;
+	PrefsManager& prefsManager = PrefsManager::instance();
+	args.append( QString("-sDEVICE=%1").arg( device ) );
+	args.append( "-c" );
+	args.append( "quit" );
 	QProcess proc;
-	proc.startCommand(command.toLocal8Bit());
+	proc.start(getShortPathName(prefsManager.ghostscriptExecutable()), args);
 	if (!proc.waitForStarted(5000))
 		return false;
 	proc.waitForFinished(5000);
@@ -230,10 +233,11 @@
 // Return the GhostScript version string, or QString() if it couldn't be retrieved.
 QString getGSVersion()
 {
-	QString command(getShortPathName(PrefsManager::instance().ghostscriptExecutable()));
-	command.append(" --version");
+	QStringList args;
+	args.append(QString("--version").toLocal8Bit());
+	QString gsExe = getShortPathName(PrefsManager::instance().ghostscriptExecutable());
 	QProcess proc;
-	proc.startCommand(command.toLocal8Bit());
+	proc.start(gsExe, args);
 	if (proc.waitForStarted(5000))
 	{
 		while (!proc.waitForFinished(5000))




More information about the scribus-commit mailing list