fix: can't execute bat file
This commit is contained in:
parent
47c1fa21a0
commit
bf245a7842
|
@ -1233,12 +1233,12 @@ void MainWindow::executeTool(PToolItem item)
|
|||
case ToolItemInputOrigin::CurrentSelection:
|
||||
e=mEditorList->getEditor();
|
||||
if (e)
|
||||
inputContent=e->selText().toUtf8();
|
||||
inputContent=stringToByteArray(e->selText(), item->isUTF8);
|
||||
break;
|
||||
case ToolItemInputOrigin::WholeDocument:
|
||||
e=mEditorList->getEditor();
|
||||
if (e)
|
||||
inputContent=e->text().toUtf8();
|
||||
inputContent=stringToByteArray(e->text(), item->isUTF8);
|
||||
break;
|
||||
}
|
||||
QString command;
|
||||
|
@ -1253,8 +1253,10 @@ void MainWindow::executeTool(PToolItem item)
|
|||
file.write(escapeCommandForPlatformShell(program, params).toLocal8Bit()
|
||||
+ LINE_BREAKER);
|
||||
file.close();
|
||||
command = escapeCommandForPlatformShell(file.fileName(), params);
|
||||
output = runAndGetOutput(file.fileName(), workDir, params, inputContent);
|
||||
QString cmd="cmd";
|
||||
QStringList args{"/C",file.fileName()};
|
||||
command = escapeCommandForPlatformShell(cmd, args);
|
||||
output = runAndGetOutput(cmd, workDir, args, inputContent);
|
||||
}
|
||||
} else {
|
||||
command = escapeCommandForPlatformShell(program, params);
|
||||
|
@ -1263,7 +1265,8 @@ void MainWindow::executeTool(PToolItem item)
|
|||
switch(item->outputTarget) {
|
||||
case ToolItemOutputTarget::RedirectToToolsOutputPanel:
|
||||
logToolsOutput(tr(" - Command: %1").arg(command));
|
||||
logToolsOutput(QString::fromUtf8(output));
|
||||
logToolsOutput("");
|
||||
logToolsOutput(byteArrayToString(output, item->isUTF8));
|
||||
stretchMessagesPanel(true);
|
||||
ui->tabMessages->setCurrentWidget(ui->tabToolsOutput);
|
||||
break;
|
||||
|
@ -1272,12 +1275,12 @@ void MainWindow::executeTool(PToolItem item)
|
|||
case ToolItemOutputTarget::RepalceWholeDocument:
|
||||
e=mEditorList->getEditor();
|
||||
if (e)
|
||||
e->replaceContent(QString::fromUtf8(output));
|
||||
e->replaceContent(byteArrayToString(output, item->isUTF8));
|
||||
break;
|
||||
case ToolItemOutputTarget::ReplaceCurrentSelection:
|
||||
e=mEditorList->getEditor();
|
||||
if (e)
|
||||
e->setSelText(QString::fromUtf8(output));
|
||||
e->setSelText(byteArrayToString(output, item->isUTF8));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ ToolsGeneralWidget::ToolsGeneralWidget(const QString &name, const QString &group
|
|||
this, &ToolsGeneralWidget::onEdited);
|
||||
connect(ui->cbOutput, qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
this, &ToolsGeneralWidget::onEdited);
|
||||
connect(ui->chkUTF8, &QCheckBox::stateChanged,
|
||||
this, &ToolsGeneralWidget::onEdited);
|
||||
}
|
||||
|
||||
ToolsGeneralWidget::~ToolsGeneralWidget()
|
||||
|
@ -118,6 +120,7 @@ void ToolsGeneralWidget::finishEditing(bool askSave)
|
|||
item->title = ui->txtTitle->text();
|
||||
item->inputOrigin = static_cast<ToolItemInputOrigin>(ui->cbInput->currentIndex());
|
||||
item->outputTarget = static_cast<ToolItemOutputTarget>(ui->cbOutput->currentIndex());
|
||||
item->isUTF8 = ui->chkUTF8->isChecked();
|
||||
mToolsModel.updateTool(mCurrentEditingRow, item);
|
||||
}
|
||||
|
||||
|
@ -138,6 +141,7 @@ void ToolsGeneralWidget::prepareEdit(int row)
|
|||
ui->txtTitle->setText(item->title);
|
||||
ui->cbInput->setCurrentIndex(static_cast<int>(item->inputOrigin));
|
||||
ui->cbOutput->setCurrentIndex(static_cast<int>(item->outputTarget));
|
||||
ui->chkUTF8->setChecked(item->isUTF8);
|
||||
showEditPanel(true);
|
||||
ui->txtTitle->setFocus();
|
||||
mEdited = false;
|
||||
|
@ -290,6 +294,7 @@ void ToolsGeneralWidget::on_btnAdd_clicked()
|
|||
item->title = tr("untitled");
|
||||
item->inputOrigin = ToolItemInputOrigin::None;
|
||||
item->outputTarget = ToolItemOutputTarget::RedirectToToolsOutputPanel;
|
||||
item->isUTF8 = false;
|
||||
mToolsModel.addTool(item);
|
||||
int row = mToolsModel.tools().count() - 1;
|
||||
QModelIndex index=mToolsModel.index(row);
|
||||
|
|
|
@ -142,7 +142,95 @@
|
|||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="9" column="0" colspan="3">
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="btnBrowseProgram">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="btnBrowseWorkingDirectory">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cbOutput"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Program</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Output To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="txtProgram"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Parameters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Redirect Input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="txtTitle"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Working Directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="txtParameters"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="3">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
|
@ -183,34 +271,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Parameters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Program</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="3">
|
||||
<item row="12" column="0" colspan="3">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -261,66 +322,9 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="txtTitle"/>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cbInput"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Working Directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cbOutput"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Output To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="txtDirectory"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="btnBrowseProgram">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="btnBrowseWorkingDirectory">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="txtProgram"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Redirect Input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="txtParameters"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="QLineEdit" name="txtDemo">
|
||||
<property name="readOnly">
|
||||
|
@ -331,10 +335,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cbInput"/>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<widget class="QCheckBox" name="chkUTF8">
|
||||
<property name="text">
|
||||
<string>Use UTF8 as the encoding</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -351,6 +358,7 @@
|
|||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>btnAdd</tabstop>
|
||||
<tabstop>btnEdit</tabstop>
|
||||
<tabstop>btnRemove</tabstop>
|
||||
<tabstop>lstTools</tabstop>
|
||||
<tabstop>txtTitle</tabstop>
|
||||
|
@ -362,6 +370,7 @@
|
|||
<tabstop>txtDemo</tabstop>
|
||||
<tabstop>cbInput</tabstop>
|
||||
<tabstop>cbOutput</tabstop>
|
||||
<tabstop>chkUTF8</tabstop>
|
||||
<tabstop>btnInsertMacro</tabstop>
|
||||
<tabstop>cbMacros</tabstop>
|
||||
<tabstop>btnEditOk</tabstop>
|
||||
|
|
|
@ -44,9 +44,10 @@ void ToolsManager::load()
|
|||
item->program = "rm";
|
||||
#endif
|
||||
item->workingDirectory = "<SOURCEPATH>";
|
||||
item->parameters = "<EXENAME>";
|
||||
item->parameters = "/q /f <EXENAME>";
|
||||
item->inputOrigin = ToolItemInputOrigin::None;
|
||||
item->outputTarget = ToolItemOutputTarget::RedirectToToolsOutputPanel;
|
||||
item->isUTF8 = false;
|
||||
mTools.append(item);
|
||||
//#ifdef Q_OS_WIN
|
||||
// item = std::make_shared<ToolItem>();
|
||||
|
@ -99,6 +100,7 @@ void ToolsManager::load()
|
|||
item->parameters = object["parameters"].toString();
|
||||
item->outputTarget = static_cast<ToolItemOutputTarget>(object["outputTarget"].toInt(0));
|
||||
item->inputOrigin= static_cast<ToolItemInputOrigin>(object["inputOrigin"].toInt(0));
|
||||
item->isUTF8 = object["isUTF8"].toBool(true);
|
||||
mTools.append(item);
|
||||
}
|
||||
}
|
||||
|
@ -124,6 +126,7 @@ void ToolsManager::save()
|
|||
object["parameters"]=tool->parameters;
|
||||
object["outputTarget"]=static_cast<int>(tool->outputTarget);
|
||||
object["inputOrigin"]=static_cast<int>(tool->inputOrigin);
|
||||
object["isUTF8"]=tool->isUTF8;
|
||||
array.append(object);
|
||||
}
|
||||
QJsonDocument doc;
|
||||
|
|
|
@ -41,6 +41,7 @@ struct ToolItem {
|
|||
QString parameters;
|
||||
ToolItemInputOrigin inputOrigin;
|
||||
ToolItemOutputTarget outputTarget;
|
||||
bool isUTF8;
|
||||
};
|
||||
|
||||
using PToolItem = std::shared_ptr<ToolItem>;
|
||||
|
|
|
@ -4276,7 +4276,7 @@
|
|||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="+14"/>
|
||||
<location filename="../mainwindow.cpp" line="+1322"/>
|
||||
<location filename="../mainwindow.cpp" line="+1324"/>
|
||||
<source>Red Panda C++</source>
|
||||
<translation>Red Panda C++</translation>
|
||||
</message>
|
||||
|
@ -5483,13 +5483,13 @@
|
|||
<translation>Ctrl+Shift+Down</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-8403"/>
|
||||
<location filename="../mainwindow.cpp" line="-8406"/>
|
||||
<location line="+72"/>
|
||||
<location line="+9"/>
|
||||
<location line="+8"/>
|
||||
<location line="+9"/>
|
||||
<location line="+61"/>
|
||||
<location line="+1356"/>
|
||||
<location line="+1359"/>
|
||||
<location line="+1799"/>
|
||||
<location line="+117"/>
|
||||
<location line="+1866"/>
|
||||
|
@ -5501,7 +5501,7 @@
|
|||
<translation>Erro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-9503"/>
|
||||
<location line="-9506"/>
|
||||
<source>New</source>
|
||||
<translation>Novo</translation>
|
||||
</message>
|
||||
|
@ -5527,18 +5527,18 @@
|
|||
</message>
|
||||
<message>
|
||||
<location line="+85"/>
|
||||
<location line="+8307"/>
|
||||
<location line="+8310"/>
|
||||
<source>Problem Set %1</source>
|
||||
<translation>Conjunto de problemas %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-7660"/>
|
||||
<location line="-7663"/>
|
||||
<location line="+6"/>
|
||||
<source>Load Theme Error</source>
|
||||
<translation>Erro ao carregar tema</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+322"/>
|
||||
<location line="+325"/>
|
||||
<location line="+2"/>
|
||||
<location line="+30"/>
|
||||
<location line="+2"/>
|
||||
|
@ -5731,12 +5731,12 @@
|
|||
<translation>Propriedades...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1603"/>
|
||||
<location line="-1604"/>
|
||||
<source> - Command: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+323"/>
|
||||
<location line="+324"/>
|
||||
<source>Line: %1/%2 Col: %3 Sel: %4</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -7018,7 +7018,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-5170"/>
|
||||
<location filename="../mainwindow.cpp" line="-5173"/>
|
||||
<source>Exact</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -7033,7 +7033,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7040"/>
|
||||
<location line="+7043"/>
|
||||
<source>Folder Not Empty</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -8381,7 +8381,7 @@
|
|||
<context>
|
||||
<name>QFileSystemModel</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-1211"/>
|
||||
<location filename="../mainwindow.cpp" line="-1214"/>
|
||||
<source><b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -8681,7 +8681,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../editorlist.cpp" line="+178"/>
|
||||
<location filename="../mainwindow.cpp" line="+3224"/>
|
||||
<location filename="../mainwindow.cpp" line="+3227"/>
|
||||
<source>Save</source>
|
||||
<translation>Salvar</translation>
|
||||
</message>
|
||||
|
@ -9000,7 +9000,7 @@
|
|||
<translation type="vanished">Índice %1 fora dos limites</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../utils.cpp" line="+480"/>
|
||||
<location filename="../utils.cpp" line="+488"/>
|
||||
<source>bytes</source>
|
||||
<translation>bytes</translation>
|
||||
</message>
|
||||
|
@ -10693,23 +10693,28 @@
|
|||
<translation>Remover</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+234"/>
|
||||
<location line="+123"/>
|
||||
<source>Output To</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+172"/>
|
||||
<source>Use UTF8 as the encoding</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-196"/>
|
||||
<location line="+7"/>
|
||||
<source>Browse</source>
|
||||
<translation>Navegar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-111"/>
|
||||
<location line="+27"/>
|
||||
<source>Parameters</source>
|
||||
<translation>Parâmetros</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+61"/>
|
||||
<location line="+129"/>
|
||||
<source>Ok</source>
|
||||
<translation>Ok</translation>
|
||||
</message>
|
||||
|
@ -10719,12 +10724,12 @@
|
|||
<translation>Cancelar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+53"/>
|
||||
<location line="-116"/>
|
||||
<source>Redirect Input</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+20"/>
|
||||
<source>Title</source>
|
||||
<translation>Título</translation>
|
||||
</message>
|
||||
|
@ -10733,22 +10738,22 @@
|
|||
<translation type="vanished">Pausar a console após término do programa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-124"/>
|
||||
<location line="-57"/>
|
||||
<source>Program</source>
|
||||
<translation>Programa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+77"/>
|
||||
<location line="+47"/>
|
||||
<source>Working Directory</source>
|
||||
<translation>Pasta de trabalho</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-110"/>
|
||||
<location line="+39"/>
|
||||
<source>Insert Macro</source>
|
||||
<translation>Inserir macro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+108"/>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+110"/>
|
||||
<source>Save Changes?</source>
|
||||
<translation>Salvar alterações?</translation>
|
||||
</message>
|
||||
|
@ -10757,7 +10762,7 @@
|
|||
<translation type="vanished">Quer salvar as alterações na ferramenta atual?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+246"/>
|
||||
<location line="+249"/>
|
||||
<source>Choose Folder</source>
|
||||
<translation>Escolher pasta</translation>
|
||||
</message>
|
||||
|
@ -10771,7 +10776,7 @@
|
|||
<translation type="vanished">Arquivos executáveis (*.exe)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-326"/>
|
||||
<location line="-331"/>
|
||||
<location line="+6"/>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -10802,7 +10807,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+61"/>
|
||||
<location line="+63"/>
|
||||
<source>Do you want to save changes to "%1"?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -10817,7 +10822,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+186"/>
|
||||
<location line="+188"/>
|
||||
<source>untitled</source>
|
||||
<translation type="unfinished">sem nome</translation>
|
||||
</message>
|
||||
|
@ -10873,7 +10878,7 @@
|
|||
<translation>Remover compilado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+27"/>
|
||||
<location line="+28"/>
|
||||
<location line="+13"/>
|
||||
<source>Read tools config failed</source>
|
||||
<translation>Falha ao ler configurações de ferramentas</translation>
|
||||
|
@ -10889,18 +10894,18 @@
|
|||
<translation>Falha ao ler arquivo de configurações de ferramentas '%1': %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+31"/>
|
||||
<location line="+21"/>
|
||||
<location line="+32"/>
|
||||
<location line="+22"/>
|
||||
<source>Save tools config failed</source>
|
||||
<translation>Falha ao salvar configurações de ferramentas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-20"/>
|
||||
<location line="-21"/>
|
||||
<source>Can't open tools config file '%1' for write.</source>
|
||||
<translation>Impossível gravar o arquivo de configurações de ferramentas '%1'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+21"/>
|
||||
<location line="+22"/>
|
||||
<source>Write to tools config file '%1' failed.</source>
|
||||
<translation>Falha ao gravar o arquivo de configurações '%1'.</translation>
|
||||
</message>
|
||||
|
|
|
@ -4629,7 +4629,7 @@ p, li { white-space: pre-wrap; }
|
|||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="+14"/>
|
||||
<location filename="../mainwindow.cpp" line="+1322"/>
|
||||
<location filename="../mainwindow.cpp" line="+1324"/>
|
||||
<source>Red Panda C++</source>
|
||||
<translation>小熊猫C++</translation>
|
||||
</message>
|
||||
|
@ -4790,7 +4790,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">工具栏2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-1704"/>
|
||||
<location filename="../mainwindow.cpp" line="-1707"/>
|
||||
<source>New</source>
|
||||
<translation>新建</translation>
|
||||
</message>
|
||||
|
@ -4923,7 +4923,7 @@ p, li { white-space: pre-wrap; }
|
|||
</message>
|
||||
<message>
|
||||
<location line="+5"/>
|
||||
<location filename="../mainwindow.cpp" line="+2704"/>
|
||||
<location filename="../mainwindow.cpp" line="+2707"/>
|
||||
<location line="+27"/>
|
||||
<location line="+200"/>
|
||||
<source>Copy</source>
|
||||
|
@ -6202,12 +6202,12 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>文件编码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-3405"/>
|
||||
<location line="-3408"/>
|
||||
<source>Recent Files</source>
|
||||
<translation>文件历史</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1066"/>
|
||||
<location line="+1069"/>
|
||||
<location line="+2"/>
|
||||
<location line="+30"/>
|
||||
<location line="+2"/>
|
||||
|
@ -6529,7 +6529,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>清除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-2912"/>
|
||||
<location filename="../mainwindow.cpp" line="-2915"/>
|
||||
<source>Export</source>
|
||||
<translation>导出</translation>
|
||||
</message>
|
||||
|
@ -6540,7 +6540,7 @@ p, li { white-space: pre-wrap; }
|
|||
</message>
|
||||
<message>
|
||||
<location line="+85"/>
|
||||
<location line="+8307"/>
|
||||
<location line="+8310"/>
|
||||
<source>Problem Set %1</source>
|
||||
<translation>试题集%1</translation>
|
||||
</message>
|
||||
|
@ -6599,12 +6599,12 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1656"/>
|
||||
<location line="-1657"/>
|
||||
<source> - Command: %1</source>
|
||||
<translation>- 命令: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+58"/>
|
||||
<location line="+59"/>
|
||||
<source> %1 Version</source>
|
||||
<translation> %1版</translation>
|
||||
</message>
|
||||
|
@ -7496,13 +7496,13 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>试题案例%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-8551"/>
|
||||
<location line="-8554"/>
|
||||
<location line="+72"/>
|
||||
<location line="+9"/>
|
||||
<location line="+8"/>
|
||||
<location line="+9"/>
|
||||
<location line="+61"/>
|
||||
<location line="+1356"/>
|
||||
<location line="+1359"/>
|
||||
<location line="+1799"/>
|
||||
<location line="+117"/>
|
||||
<location line="+1866"/>
|
||||
|
@ -7514,7 +7514,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-9481"/>
|
||||
<location line="-9484"/>
|
||||
<source>Recent Projects</source>
|
||||
<translation>项目历史</translation>
|
||||
</message>
|
||||
|
@ -7525,7 +7525,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>载入主题失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+450"/>
|
||||
<location line="+453"/>
|
||||
<location line="+22"/>
|
||||
<source>Clear History</source>
|
||||
<translation>清除历史</translation>
|
||||
|
@ -7589,7 +7589,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>确认转换</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-9582"/>
|
||||
<location line="-9585"/>
|
||||
<source>Exact</source>
|
||||
<translation>完全一致</translation>
|
||||
</message>
|
||||
|
@ -7608,7 +7608,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">行: %1 列: %2 (%3个字符) 总行数: %4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+2309"/>
|
||||
<location line="+2312"/>
|
||||
<location line="+123"/>
|
||||
<location line="+2724"/>
|
||||
<source>If you are using the Release compiler set, please use choose the Debug version from toolbar.</source>
|
||||
|
@ -9057,7 +9057,7 @@ p, li { white-space: pre-wrap; }
|
|||
<context>
|
||||
<name>QFileSystemModel</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-6537"/>
|
||||
<location filename="../mainwindow.cpp" line="-6540"/>
|
||||
<source><b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks.</source>
|
||||
<translation><b>文件名 "%1" 无法被使用!</b><p>可能是重名、过长、为空或者是使用了不能出现在文件名里的符号。</translation>
|
||||
</message>
|
||||
|
@ -9066,7 +9066,7 @@ p, li { white-space: pre-wrap; }
|
|||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../editorlist.cpp" line="+178"/>
|
||||
<location filename="../mainwindow.cpp" line="+3224"/>
|
||||
<location filename="../mainwindow.cpp" line="+3227"/>
|
||||
<source>Save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
|
@ -9551,7 +9551,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">下标"%1"越界</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../utils.cpp" line="+480"/>
|
||||
<location filename="../utils.cpp" line="+488"/>
|
||||
<source>bytes</source>
|
||||
<translation>字节</translation>
|
||||
</message>
|
||||
|
@ -11589,23 +11589,28 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+234"/>
|
||||
<location line="+123"/>
|
||||
<source>Output To</source>
|
||||
<translation>输出到</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+172"/>
|
||||
<source>Use UTF8 as the encoding</source>
|
||||
<translation>使用UTF8文件编码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-196"/>
|
||||
<location line="+7"/>
|
||||
<source>Browse</source>
|
||||
<translation>浏览</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-111"/>
|
||||
<location line="+27"/>
|
||||
<source>Parameters</source>
|
||||
<translation>参数</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+61"/>
|
||||
<location line="+129"/>
|
||||
<source>Ok</source>
|
||||
<translation>确定</translation>
|
||||
</message>
|
||||
|
@ -11615,12 +11620,12 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+53"/>
|
||||
<location line="-116"/>
|
||||
<source>Redirect Input</source>
|
||||
<translation>重定向输入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+20"/>
|
||||
<source>Title</source>
|
||||
<translation>名称</translation>
|
||||
</message>
|
||||
|
@ -11629,22 +11634,22 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">程序在主控台中结束运行后暂停</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-124"/>
|
||||
<location line="-57"/>
|
||||
<source>Program</source>
|
||||
<translation>程序</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+77"/>
|
||||
<location line="+47"/>
|
||||
<source>Working Directory</source>
|
||||
<translation>工作文件夹</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-110"/>
|
||||
<location line="+39"/>
|
||||
<source>Insert Macro</source>
|
||||
<translation>插入宏指令</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+108"/>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+110"/>
|
||||
<source>Save Changes?</source>
|
||||
<translation>保存修改?</translation>
|
||||
</message>
|
||||
|
@ -11653,7 +11658,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">您需要保存对当前工具的修改吗?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-69"/>
|
||||
<location line="-71"/>
|
||||
<location line="+6"/>
|
||||
<source>None</source>
|
||||
<translation>无</translation>
|
||||
|
@ -11684,7 +11689,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>替换整个文档</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+61"/>
|
||||
<location line="+63"/>
|
||||
<source>Do you want to save changes to "%1"?</source>
|
||||
<translation>要保存对"%1"的修改吗?</translation>
|
||||
</message>
|
||||
|
@ -11699,12 +11704,12 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>标题不可以为空!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+186"/>
|
||||
<location line="+188"/>
|
||||
<source>untitled</source>
|
||||
<translation>无标题</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+64"/>
|
||||
<location line="+65"/>
|
||||
<source>Choose Folder</source>
|
||||
<translation>选择文件夹</translation>
|
||||
</message>
|
||||
|
@ -11777,7 +11782,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">在文件管理器中打开编译结果</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+27"/>
|
||||
<location line="+28"/>
|
||||
<location line="+13"/>
|
||||
<source>Read tools config failed</source>
|
||||
<translation>读取工具配置失败</translation>
|
||||
|
@ -11793,18 +11798,18 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>读取工具配置文件'%1'失败:%2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+31"/>
|
||||
<location line="+21"/>
|
||||
<location line="+32"/>
|
||||
<location line="+22"/>
|
||||
<source>Save tools config failed</source>
|
||||
<translation>保存工具配置失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-20"/>
|
||||
<location line="-21"/>
|
||||
<source>Can't open tools config file '%1' for write.</source>
|
||||
<translation>无法写入工具配置文件'%1'。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+21"/>
|
||||
<location line="+22"/>
|
||||
<source>Write to tools config file '%1' failed.</source>
|
||||
<oldsource>Write to tool config file '%1' failed.</oldsource>
|
||||
<translation>写入工具配置文件'%1'失败。</translation>
|
||||
|
|
|
@ -4061,7 +4061,7 @@
|
|||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="+14"/>
|
||||
<location filename="../mainwindow.cpp" line="+1322"/>
|
||||
<location filename="../mainwindow.cpp" line="+1324"/>
|
||||
<source>Red Panda C++</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -5255,13 +5255,13 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-8403"/>
|
||||
<location filename="../mainwindow.cpp" line="-8406"/>
|
||||
<location line="+72"/>
|
||||
<location line="+9"/>
|
||||
<location line="+8"/>
|
||||
<location line="+9"/>
|
||||
<location line="+61"/>
|
||||
<location line="+1356"/>
|
||||
<location line="+1359"/>
|
||||
<location line="+1799"/>
|
||||
<location line="+117"/>
|
||||
<location line="+1866"/>
|
||||
|
@ -5273,7 +5273,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-9503"/>
|
||||
<location line="-9506"/>
|
||||
<source>New</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -5299,18 +5299,18 @@
|
|||
</message>
|
||||
<message>
|
||||
<location line="+85"/>
|
||||
<location line="+8307"/>
|
||||
<location line="+8310"/>
|
||||
<source>Problem Set %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-7660"/>
|
||||
<location line="-7663"/>
|
||||
<location line="+6"/>
|
||||
<source>Load Theme Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+322"/>
|
||||
<location line="+325"/>
|
||||
<location line="+2"/>
|
||||
<location line="+30"/>
|
||||
<location line="+2"/>
|
||||
|
@ -5444,12 +5444,12 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1603"/>
|
||||
<location line="-1604"/>
|
||||
<source> - Command: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+323"/>
|
||||
<location line="+324"/>
|
||||
<source>Line: %1/%2 Col: %3 Sel: %4</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -6711,7 +6711,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-5170"/>
|
||||
<location filename="../mainwindow.cpp" line="-5173"/>
|
||||
<source>Exact</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -6726,7 +6726,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7040"/>
|
||||
<location line="+7043"/>
|
||||
<source>Folder Not Empty</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -7981,7 +7981,7 @@
|
|||
<context>
|
||||
<name>QFileSystemModel</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="-1211"/>
|
||||
<location filename="../mainwindow.cpp" line="-1214"/>
|
||||
<source><b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -8274,7 +8274,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../editorlist.cpp" line="+178"/>
|
||||
<location filename="../mainwindow.cpp" line="+3224"/>
|
||||
<location filename="../mainwindow.cpp" line="+3227"/>
|
||||
<source>Save</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -8483,7 +8483,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../utils.cpp" line="+480"/>
|
||||
<location filename="../utils.cpp" line="+488"/>
|
||||
<source>bytes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -9924,23 +9924,28 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+234"/>
|
||||
<location line="+123"/>
|
||||
<source>Output To</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+172"/>
|
||||
<source>Use UTF8 as the encoding</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-196"/>
|
||||
<location line="+7"/>
|
||||
<source>Browse</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-111"/>
|
||||
<location line="+27"/>
|
||||
<source>Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+61"/>
|
||||
<location line="+129"/>
|
||||
<source>Ok</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -9950,37 +9955,37 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+53"/>
|
||||
<location line="-116"/>
|
||||
<source>Redirect Input</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+10"/>
|
||||
<location line="+20"/>
|
||||
<source>Title</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-124"/>
|
||||
<location line="-57"/>
|
||||
<source>Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+77"/>
|
||||
<location line="+47"/>
|
||||
<source>Working Directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-110"/>
|
||||
<location line="+39"/>
|
||||
<source>Insert Macro</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+108"/>
|
||||
<location filename="../settingsdialog/toolsgeneralwidget.cpp" line="+110"/>
|
||||
<source>Save Changes?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+246"/>
|
||||
<location line="+249"/>
|
||||
<source>Choose Folder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -9990,12 +9995,12 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-256"/>
|
||||
<location line="-259"/>
|
||||
<source>Do you want to save changes to "%1"?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-70"/>
|
||||
<location line="-72"/>
|
||||
<location line="+6"/>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -10026,7 +10031,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+55"/>
|
||||
<location line="+57"/>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -10036,7 +10041,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+186"/>
|
||||
<location line="+188"/>
|
||||
<source>untitled</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -10092,7 +10097,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+27"/>
|
||||
<location line="+28"/>
|
||||
<location line="+13"/>
|
||||
<source>Read tools config failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -10108,18 +10113,18 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+31"/>
|
||||
<location line="+21"/>
|
||||
<location line="+32"/>
|
||||
<location line="+22"/>
|
||||
<source>Save tools config failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-20"/>
|
||||
<location line="-21"/>
|
||||
<source>Can't open tools config file '%1' for write.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+21"/>
|
||||
<location line="+22"/>
|
||||
<source>Write to tools config file '%1' failed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -357,6 +357,7 @@ QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const
|
|||
{
|
||||
QProcess process;
|
||||
QByteArray result;
|
||||
bool errorOccurred = false;
|
||||
if (env.isEmpty()) {
|
||||
if (inheritEnvironment) {
|
||||
process.setProcessEnvironment(QProcessEnvironment::systemEnvironment());
|
||||
|
@ -375,12 +376,19 @@ QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const
|
|||
[&](){
|
||||
result.append(process.readAllStandardOutput());
|
||||
});
|
||||
process.connect(&process, &QProcess::errorOccurred,
|
||||
[&](){
|
||||
errorOccurred= true;
|
||||
});
|
||||
process.start(cmd,arguments);
|
||||
if (!inputContent.isEmpty()) {
|
||||
process.write(inputContent);
|
||||
}
|
||||
process.closeWriteChannel();
|
||||
process.waitForFinished();
|
||||
if (errorOccurred) {
|
||||
result += process.errorString().toUtf8();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -613,3 +621,19 @@ QString osArch()
|
|||
return QSysInfo::currentCpuArchitecture();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString byteArrayToString(const QByteArray &content, bool isUTF8)
|
||||
{
|
||||
if (isUTF8)
|
||||
return QString::fromUtf8(content);
|
||||
else
|
||||
return QString::fromLocal8Bit(content);
|
||||
}
|
||||
|
||||
QByteArray stringToByteArray(const QString &content, bool isUTF8)
|
||||
{
|
||||
if (isUTF8)
|
||||
return content.toUtf8();
|
||||
else
|
||||
return content.toLocal8Bit();
|
||||
}
|
||||
|
|
|
@ -173,6 +173,9 @@ QStringList platformCommandForTerminalArgsPreview();
|
|||
QString appArch();
|
||||
QString osArch();
|
||||
|
||||
QString byteArrayToString(const QByteArray &content, bool isUTF8);
|
||||
QByteArray stringToByteArray(const QString& content, bool isUTF8);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define __builtin_unreachable() (__assume(0))
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue