From 886205b149d0aa3f5ca0a1ff8e761760dd1a2263 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 8 Aug 2023 21:15:45 +0200 Subject: [PATCH] FileUtils: Use Process::startDetached() instead of QProcess Reading data from the detached process is no-op. Change-Id: I128ecc5298e0e6d4a73ecfceba55bc147ffd3a58 Reviewed-by: hjk --- src/plugins/coreplugin/fileutils.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 8b1a5122d35..e432543604f 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -31,7 +31,6 @@ #include #include #include -#include using namespace Utils; @@ -82,12 +81,8 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn) if (browserArgs.isEmpty()) { error = Tr::tr("The command for file browser is not set."); } else { - QProcess browserProc; - browserProc.setProgram(browserArgs.takeFirst()); - browserProc.setArguments(browserArgs); - const bool success = browserProc.startDetached(); - error = QString::fromLocal8Bit(browserProc.readAllStandardError()); - if (!success && error.isEmpty()) + const QString executable = browserArgs.takeFirst(); + if (!Process::startDetached({FilePath::fromString(executable), browserArgs})) error = Tr::tr("Error while starting file browser."); } if (!error.isEmpty())