mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix PlantUML command
This commit is contained in:
parent
6e22229eb9
commit
39795c3daa
@ -46,7 +46,7 @@ void VPlantUMLHelper::processAsync(int p_id,
|
|||||||
QStringList args(m_args);
|
QStringList args(m_args);
|
||||||
args << ("-t" + p_format);
|
args << ("-t" + p_format);
|
||||||
qDebug() << m_program << args;
|
qDebug() << m_program << args;
|
||||||
process->start(m_program, args);
|
process->start(m_program, refineArgsForUse(args));
|
||||||
} else {
|
} else {
|
||||||
QString cmd(m_customCmd);
|
QString cmd(m_customCmd);
|
||||||
cmd.replace("%0", p_format);
|
cmd.replace("%0", p_format);
|
||||||
@ -143,6 +143,7 @@ bool VPlantUMLHelper::testPlantUMLJar(const QString &p_jar, QString &p_msg)
|
|||||||
VPlantUMLHelper inst(p_jar);
|
VPlantUMLHelper inst(p_jar);
|
||||||
QStringList args(inst.m_args);
|
QStringList args(inst.m_args);
|
||||||
args << "-tsvg";
|
args << "-tsvg";
|
||||||
|
args = refineArgsForUse(args);
|
||||||
|
|
||||||
QString testGraph("VNote->Markdown : hello");
|
QString testGraph("VNote->Markdown : hello");
|
||||||
|
|
||||||
@ -175,6 +176,7 @@ QByteArray VPlantUMLHelper::process(const QString &p_format, const QString &p_te
|
|||||||
if (inst.m_customCmd.isEmpty()) {
|
if (inst.m_customCmd.isEmpty()) {
|
||||||
QStringList args(inst.m_args);
|
QStringList args(inst.m_args);
|
||||||
args << ("-t" + p_format);
|
args << ("-t" + p_format);
|
||||||
|
args = refineArgsForUse(args);
|
||||||
ret = VProcessUtils::startProcess(inst.m_program,
|
ret = VProcessUtils::startProcess(inst.m_program,
|
||||||
args,
|
args,
|
||||||
p_text.toUtf8(),
|
p_text.toUtf8(),
|
||||||
@ -1109,3 +1111,23 @@ creole:
|
|||||||
tryCreole(kw);
|
tryCreole(kw);
|
||||||
return kw;
|
return kw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList VPlantUMLHelper::refineArgsForUse(const QStringList &p_args)
|
||||||
|
{
|
||||||
|
if (p_args.isEmpty()) {
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p_args[0] == "-c") {
|
||||||
|
QStringList args;
|
||||||
|
args << p_args[0];
|
||||||
|
QString subCmd;
|
||||||
|
for (int i = 1; i < p_args.size(); ++i) {
|
||||||
|
subCmd += " " + p_args[i];
|
||||||
|
}
|
||||||
|
args << subCmd;
|
||||||
|
return args;
|
||||||
|
} else {
|
||||||
|
return p_args;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -41,6 +41,8 @@ private:
|
|||||||
|
|
||||||
void prepareCommand(QString &p_cmd, QStringList &p_args, const QString &p_jar= QString()) const;
|
void prepareCommand(QString &p_cmd, QStringList &p_args, const QString &p_jar= QString()) const;
|
||||||
|
|
||||||
|
static QStringList refineArgsForUse(const QStringList &p_args);
|
||||||
|
|
||||||
QString m_program;
|
QString m_program;
|
||||||
|
|
||||||
QStringList m_args;
|
QStringList m_args;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user