From b705cc28ea3e0731d22e797e6ca45f603c477d09 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Fri, 1 May 2020 20:54:33 +0200 Subject: [PATCH] add ppm2pwg as a submodule --- .gitmodules | 3 +++ harbour-seaprint.pro | 11 +++++++++++ ppm2pwg | 1 + src/convertworker.cpp | 5 ++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 ppm2pwg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..16d56a3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ppm2pwg"] + path = ppm2pwg + url = https://github.com/attah/ppm2pwg.git diff --git a/harbour-seaprint.pro b/harbour-seaprint.pro index 82bdc61..89554b7 100644 --- a/harbour-seaprint.pro +++ b/harbour-seaprint.pro @@ -66,3 +66,14 @@ HEADERS += \ src/ippmsg.h \ src/ippprinter.h \ src/mimer.h + + +QMAKE_EXTRA_TARGETS += PPM2PWG +PRE_TARGETDEPS += PPM2PWG +PPM2PWG.commands = make -C $$PWD/ppm2pwg +PPM2PWG.clean_commands = git submodule foreach git clean -fdxq +PPM2PWG.path = /usr/share/harbour-seaprint/ +PPM2PWG.files += $$PWD/ppm2pwg/ppm2pwg + +INSTALLS += PPM2PWG +QMAKE_INSTALL_FILE = install -m 755 -p diff --git a/ppm2pwg b/ppm2pwg new file mode 160000 index 0000000..a3ea2da --- /dev/null +++ b/ppm2pwg @@ -0,0 +1 @@ +Subproject commit a3ea2da52a0b8432ba7e6ec59451ae3887b1a111 diff --git a/src/convertworker.cpp b/src/convertworker.cpp index 4d3e8c1..dd5f599 100644 --- a/src/convertworker.cpp +++ b/src/convertworker.cpp @@ -1,4 +1,5 @@ #include "convertworker.h" +#include void ConvertWorker::convertPdf(QNetworkRequest request, QString filename, QTemporaryFile* tempfile) { @@ -9,7 +10,9 @@ void ConvertWorker::convertPdf(QNetworkRequest request, QString filename, QTempo QProcess* ppm2pwg = new QProcess(this); - ppm2pwg->setProgram("/home/nemo/repos/pwg/ppm2pwg"); + qDebug() << SailfishApp::pathTo("ppm2pwg").toString(); + QString Ppm2pwgPath = SailfishApp::pathTo("ppm2pwg").toString().remove("file://"); + ppm2pwg->setProgram(Ppm2pwgPath); QStringList env; // {"PREPEND_FILE="+tempfile->fileName()}; bool apple = false;