Fix deprecation warning in QProcess::execute(QString)

Implement this method in terms of splitCommand and
QProcess::execute(QString, QStringList).

Change-Id: I1fe78fb53d8b6b34a8796f9fbda380a98a840c99
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Joerg Bornemann 2020-03-05 14:17:59 +01:00
parent a539e53eb0
commit 66e905b1c3

View File

@ -2519,12 +2519,10 @@ int QProcess::execute(const QString &program, const QStringList &arguments)
*/
int QProcess::execute(const QString &command)
{
QProcess process;
process.setProcessChannelMode(ForwardedChannels);
process.start(command);
if (!process.waitForFinished(-1) || process.error() == FailedToStart)
QStringList args = splitCommand(command);
if (args.isEmpty())
return -2;
return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
return execute(args.takeFirst(), args);
}
/*!