PlantUml/Graphviz: support relative path

This commit is contained in:
Le Tan 2021-08-15 09:44:30 +08:00
parent 0530422a9b
commit a9005bef23
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <QDir> #include <QDir>
#include <utils/processutils.h> #include <utils/processutils.h>
#include <utils/pathutils.h>
using namespace vnotex; using namespace vnotex;
@ -38,7 +39,7 @@ void GraphvizHelper::prepareProgramAndArgs(const QString &p_graphvizFile,
p_program.clear(); p_program.clear();
p_args.clear(); p_args.clear();
p_program = p_graphvizFile.isEmpty() ? QStringLiteral("dot") : QDir::toNativeSeparators(p_graphvizFile); p_program = p_graphvizFile.isEmpty() ? QStringLiteral("dot") : QDir::toNativeSeparators(PathUtils::absolutePath(p_graphvizFile));
} }
QPair<bool, QString> GraphvizHelper::testGraphviz(const QString &p_graphvizFile) QPair<bool, QString> GraphvizHelper::testGraphviz(const QString &p_graphvizFile)

View File

@ -4,6 +4,7 @@
#include <QDir> #include <QDir>
#include <utils/processutils.h> #include <utils/processutils.h>
#include <utils/pathutils.h>
using namespace vnotex; using namespace vnotex;
@ -61,12 +62,12 @@ void PlantUmlHelper::prepareProgramAndArgs(const QString &p_plantUmlJarFile,
p_args << "-Djava.awt.headless=true"; p_args << "-Djava.awt.headless=true";
#endif #endif
p_args << "-jar" << QDir::toNativeSeparators(p_plantUmlJarFile); p_args << "-jar" << QDir::toNativeSeparators(PathUtils::absolutePath(p_plantUmlJarFile));
p_args << "-charset" << "UTF-8"; p_args << "-charset" << "UTF-8";
if (!p_graphvizFile.isEmpty()) { if (!p_graphvizFile.isEmpty()) {
p_args << "-graphvizdot" << QDir::toNativeSeparators(p_graphvizFile); p_args << "-graphvizdot" << QDir::toNativeSeparators(PathUtils::absolutePath(p_graphvizFile));
} }
p_args << "-pipe"; p_args << "-pipe";