From 7fedf86d4e22dc3cd1b90673eb87927e022830a5 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 2 Apr 2024 20:37:28 +0800 Subject: [PATCH] fix for linux --- RedPandaIDE/mainwindow.cpp | 5 ++++- RedPandaIDE/toolsmanager.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 171bc95f..c1fe3731 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1242,7 +1242,7 @@ void MainWindow::executeTool(PToolItem item) break; } QString command; - +#ifdef Q_OS_WIN if (!fileExists(program)) { QTemporaryFile file(QDir::tempPath()+QDir::separator()+"XXXXXX.bat"); file.setAutoRemove(false); @@ -1262,9 +1262,12 @@ void MainWindow::executeTool(PToolItem item) output = runAndGetOutput(cmd, workDir, args, inputContent); } } else { +#endif command = escapeCommandForPlatformShell(program, params); output = runAndGetOutput(program, workDir, params, inputContent); +#ifdef Q_OS_WIN } +#endif switch(item->outputTarget) { case ToolItemOutputTarget::RedirectToToolsOutputPanel: logToolsOutput(tr(" - Command: %1").arg(command)); diff --git a/RedPandaIDE/toolsmanager.cpp b/RedPandaIDE/toolsmanager.cpp index 7775e8ef..36f07623 100644 --- a/RedPandaIDE/toolsmanager.cpp +++ b/RedPandaIDE/toolsmanager.cpp @@ -44,7 +44,11 @@ void ToolsManager::load() item->program = "rm"; #endif item->workingDirectory = ""; +#ifdef Q_OS_WIN item->parameters = "/q /f "; +#else + item->parameters = "-f "; +#endif item->inputOrigin = ToolItemInputOrigin::None; item->outputTarget = ToolItemOutputTarget::RedirectToToolsOutputPanel; item->isUTF8 = false;