Replace deprecated use of QProcess::execute()
authorFelix Weilbach <felix.weilbach@nextcloud.com>
Fri, 3 Sep 2021 20:09:19 +0000 (22:09 +0200)
committerFelix Weilbach (Rebase PR Action) <felix.weilbach@t-online.de>
Wed, 8 Sep 2021 08:54:00 +0000 (08:54 +0000)
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
src/libsync/syncengine.cpp

index d531fcc7d4ef8b99fa1f14c7e45614dcd36651c5..38f49785af90f9ec39073524e3af97ccc4261afd 100644 (file)
@@ -690,8 +690,12 @@ void SyncEngine::slotDiscoveryFinished()
             const QString script = qEnvironmentVariable("OWNCLOUD_POST_UPDATE_SCRIPT");
 
             qCDebug(lcEngine) << "Post Update Script: " << script;
-            QProcess::execute(script);
-    #else
+            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
         }