Replace deprecated use of QProcess::execute()

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
This commit is contained in:
Felix Weilbach 2021-09-03 22:09:19 +02:00 committed by Felix Weilbach (Rebase PR Action)
parent c9863dc225
commit 93f590c6de

View file

@ -690,7 +690,11 @@ void SyncEngine::slotDiscoveryFinished()
const QString script = qEnvironmentVariable("OWNCLOUD_POST_UPDATE_SCRIPT");
qCDebug(lcEngine) << "Post Update Script: " << script;
QProcess::execute(script);
auto scriptArgs = script.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
if (scriptArgs.size() > 0) {
const auto scriptExecutable = scriptArgs.takeFirst();
QProcess::execute(scriptExecutable, scriptArgs);
}
#else
qCWarning(lcEngine) << "**** Attention: POST_UPDATE_SCRIPT installed, but not executed because compiled with NDEBUG";
#endif