File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -849,11 +849,16 @@ void MainWindow::undoDelete()
849849}
850850
851851void MainWindow::runCommand ()
852- {
852+ {
853853 auto fileInfo = graphicsView->getCurrentFileDetails ().fileInfo ;
854854
855855 QString commandString = qvApp->getSettingsManager ().getString (" commandstring" );
856856 commandString.replace (" %QVIEW_PATH%" , ' "' + fileInfo.filePath () + ' "' );
857+
858+ #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
859+ // this method is obsolete, but useful on older QT versions with no QProcess::splitCommand
860+ QProcess::startDetached (commandString);
861+ #else
857862 QStringList commandList = QProcess::splitCommand (commandString);
858863
859864 if (commandList.empty ())
@@ -863,16 +868,8 @@ void MainWindow::runCommand()
863868 QStringList arguments = commandList;
864869 arguments.removeFirst ();
865870
866- QProcess commandProcess;
867- commandProcess.setProgram (program);
868- commandProcess.setArguments (arguments);
869- commandProcess.setWorkingDirectory (fileInfo.dir ().path ());
870- commandProcess.setStandardErrorFile (QProcess::nullDevice ());
871- commandProcess.setStandardInputFile (QProcess::nullDevice ());
872- commandProcess.setStandardOutputFile (QProcess::nullDevice ());
873-
874- qint64 pid;
875- commandProcess.startDetached (&pid);
871+ QProcess::startDetached (program, arguments, fileInfo.dir ().path ());
872+ #endif
876873}
877874
878875void MainWindow::copy ()
You can’t perform that action at this time.
0 commit comments