X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=xsltproc.cpp;fp=xsltproc.cpp;h=0000000000000000000000000000000000000000;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0739fc0f9c69aa3204e864246cc7998f4da9dfef;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/xsltproc.cpp b/xsltproc.cpp deleted file mode 100644 index 0739fc0..0000000 --- a/xsltproc.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "xsltproc.h" - -#include -#include -#include - -#include "vymprocess.h" - - -extern bool debug; - -XSLTProc::XSLTProc () -{ - xsltprocessor="xsltproc"; - showOutput=false; - dia=new ShowTextDialog; -} - -XSLTProc::~XSLTProc () -{ - delete (dia); -} - -void XSLTProc::addStringParam (const QString & k, const QString &v) -{ - stringParamKey.append (k); - stringParamVal.append (v); -} - -void XSLTProc::setOutputFile (const QString &s) -{ - outputFile=s; -} - -void XSLTProc::setXSLFile(const QString &s) -{ - xslFile=s; -} - -void XSLTProc::setInputFile (const QString &s) -{ - inputFile=s; -} - -void XSLTProc::addOutput (const QString &s) -{ - dia->append (s); -} - -void XSLTProc::process() -{ - ShowTextDialog dia; - dia.useFixedFont (true); - QStringList args; - VymProcess *xsltProc=new VymProcess (); - - QStringList::Iterator itk; - QStringList::Iterator itv=stringParamVal.begin(); - - for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk ) - { - args << "--stringparam"; - args << *itk; - args << *itv; - ++itv; - } - - args << "--output"; - args << outputFile; - args << xslFile; - args << inputFile; - QString com=xsltprocessor+" "+args.join(" "); - if (debug) qDebug() <<"xsltproc executing:\n"<start(xsltprocessor,args); - if (!xsltProc->waitForStarted() ) - { - QMessageBox::critical( 0, QObject::tr( "Critical Error" ), - QObject::tr("Could not start %1").arg(xsltprocessor) ); - } else - { - if (!xsltProc->waitForFinished()) - { - QMessageBox::critical( 0, QObject::tr( "Critical Error" ), - QObject::tr("%1 didn't exit normally").arg(xsltprocessor) + - xsltProc->getErrout() ); - if (xsltProc->exitStatus()>0) showOutput=true; - } - - } - dia.append ("\n"); - dia.append (xsltProc->getErrout()); - dia.append (xsltProc->getStdout()); - - if (showOutput) dia.exec(); -} -