minor changes

This commit is contained in:
Roy Qu 2024-04-02 17:25:54 +08:00
parent 24f88f8d35
commit 47c1fa21a0
1 changed files with 3 additions and 4 deletions

View File

@ -43,7 +43,6 @@
#include "iconsmanager.h" #include "iconsmanager.h"
#include "widgets/newclassdialog.h" #include "widgets/newclassdialog.h"
#include "widgets/newheaderdialog.h" #include "widgets/newheaderdialog.h"
#include "utils/escape.h"
#ifdef ENABLE_LUA_ADDON #ifdef ENABLE_LUA_ADDON
#include "addon/executor.h" #include "addon/executor.h"
#include "addon/runtime.h" #include "addon/runtime.h"
@ -1227,6 +1226,7 @@ void MainWindow::executeTool(PToolItem item)
Editor *e; Editor *e;
QByteArray inputContent; QByteArray inputContent;
QByteArray output; QByteArray output;
clearToolsOutput();
switch(item->inputOrigin) { switch(item->inputOrigin) {
case ToolItemInputOrigin::None: case ToolItemInputOrigin::None:
break; break;
@ -1253,16 +1253,15 @@ void MainWindow::executeTool(PToolItem item)
file.write(escapeCommandForPlatformShell(program, params).toLocal8Bit() file.write(escapeCommandForPlatformShell(program, params).toLocal8Bit()
+ LINE_BREAKER); + LINE_BREAKER);
file.close(); file.close();
command = escapeCommandForLog(file.fileName(), params); command = escapeCommandForPlatformShell(file.fileName(), params);
output = runAndGetOutput(file.fileName(), workDir, params, inputContent); output = runAndGetOutput(file.fileName(), workDir, params, inputContent);
} }
} else { } else {
command = escapeCommandForLog(program, params); command = escapeCommandForPlatformShell(program, params);
output = runAndGetOutput(program, workDir, params, inputContent); output = runAndGetOutput(program, workDir, params, inputContent);
} }
switch(item->outputTarget) { switch(item->outputTarget) {
case ToolItemOutputTarget::RedirectToToolsOutputPanel: case ToolItemOutputTarget::RedirectToToolsOutputPanel:
clearToolsOutput();
logToolsOutput(tr(" - Command: %1").arg(command)); logToolsOutput(tr(" - Command: %1").arg(command));
logToolsOutput(QString::fromUtf8(output)); logToolsOutput(QString::fromUtf8(output));
stretchMessagesPanel(true); stretchMessagesPanel(true);