From a1ea7a111eeb0761a5e3c3a9d37d1fe24b6a13b2 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 4 Jun 2020 15:13:50 +0800 Subject: [PATCH] Don't use deprecated QProcess::startDetached() overload --- src/app/application.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/application.cpp b/src/app/application.cpp index 71dcca1b6..253fc14e8 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -387,8 +387,17 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c // enable command injection via torrent name and other arguments // (especially when some automated download mechanism has been setup). // See: https://github.com/qbittorrent/qBittorrent/issues/10925 +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + QStringList args = QProcess::splitCommand(program); + if (args.isEmpty()) + return; + + const QString command = args.takeFirst(); + QProcess::startDetached(command, args); +#else QProcess::startDetached(program); #endif +#endif } void Application::sendNotificationEmail(const BitTorrent::TorrentHandle *torrent)