cement: If console pauser doesn't exist, warn and stop running programs.

This commit is contained in:
Roy Qu 2022-01-20 00:12:50 +08:00
parent e161ec42ae
commit 9af7c736d9
3 changed files with 13 additions and 2 deletions

View File

@ -7,6 +7,7 @@ Red Panda C++ Version 0.13.3
- fix: symbols defind locally should be sorted to the front in the code suggestion popup list
- fix: when show function tips, can't correctly calcuate the current position in the function param list
- fix: app will become very slow when processing very long lines.
- enhancement: If console pauser doesn't exist, warn and stop running programs.
Red Panda C++ Version 0.13.2
- fix: "delete and exit" button in the environtment / folder option page doesn't work correctly

View File

@ -248,16 +248,25 @@ void CompilerManager::run(const QString &filename, const QString &arguments, con
#else
QString newArguments;
if (consoleFlag!=0) {
QString consolePauserPath=includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"consolepauser";
if (!fileExists(consolePauserPath)) {
QMessageBox::critical(pMainWindow,
tr("Can't find Console Pauser"),
tr("Console Pauser \"%1\" doesn't exists!")
.arg(consolePauserPath));
return;
}
if (redirectInput) {
newArguments = QString(" -e \"%1\" %2 \"%3\" \"%4\" %5")
.arg(includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"consolepauser")
.arg(consolePauserPath)
.arg(consoleFlag)
.arg(redirectInputFilename)
.arg(localizePath(filename))
.arg(arguments);
} else {
newArguments = QString(" -e \"%1\" %2 \"%3\" %4")
.arg(includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"consolepauser")
.arg(consolePauserPath)
.arg(consoleFlag)
.arg(localizePath(filename)).arg(arguments);
}

View File

@ -84,6 +84,7 @@ void ExecutableRunner::run()
mProcess = std::make_shared<QProcess>();
mProcess->setProgram(mFilename);
mProcess->setArguments(splitProcessCommand(mArguments));
qDebug()<<splitProcessCommand(mArguments);
mProcess->setWorkingDirectory(mWorkDir);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString path = env.value("PATH");