From 67c85f54c4d7422b715898070e63dfe7a984a6ca Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 20 May 2021 13:17:55 +0200 Subject: [PATCH] Fixup 9f92fc92: improve FIXME in SystemcallPrivate::startProcess I wanted to remove the test Qt >= 5.15, but now I see that it is not possible because of QProcess::splitCommand. Neverthless, the best would be to change parsecmd. --- src/support/Systemcall.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 00adbf8a22..f3703b8889 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -370,6 +370,14 @@ void SystemcallPrivate::startProcess(QString const & cmd, string const & path, cmd_ = cmd; #if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // FIXME pass command and arguments separated in the first place + /* The versions of startDetached() and start() that accept a + * QStringList object exist since Qt4, but it is only in Qt 5.15 + * that splitCommand() was introduced and the plain versions of + * start/startDetached() have been deprecated. + * The cleanest solution would be to have parsecmd() produce a + * QStringList for arguments, instead of transforming the string + * into something that the QProcess splitter accepts. + */ QStringList arguments = QProcess::splitCommand(toqstr(latexEnvCmdPrefix(path, lpath)) + cmd_); QString command = (arguments.empty()) ? QString() : arguments.first(); if (arguments.size() == 1) -- 2.39.5