xsltproc.cpp
changeset 417 1cc7bbf75f0b
parent 265 96b8406d4a2f
child 430 f001beefdec2
     1.1 --- a/xsltproc.cpp	Mon Mar 27 20:21:58 2006 +0000
     1.2 +++ b/xsltproc.cpp	Fri Jan 05 11:17:32 2007 +0000
     1.3 @@ -47,34 +47,34 @@
     1.4  void XSLTProc::process()
     1.5  {
     1.6  	ShowTextDialog dia;
     1.7 +	QStringList args;
     1.8  	Process *xsltProc=new Process ();
     1.9 -	xsltProc->clearArguments();
    1.10 -	xsltProc->addArgument (xsltprocessor);	
    1.11  
    1.12  	QStringList::Iterator itk;
    1.13  	QStringList::Iterator itv=stringParamVal.begin();
    1.14  
    1.15  	for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk ) 
    1.16  	{
    1.17 -		xsltProc->addArgument ("--stringparam");
    1.18 -		xsltProc->addArgument (*itk);
    1.19 -		xsltProc->addArgument (*itv);
    1.20 +		args << "--stringparam";
    1.21 +		args << *itk;
    1.22 +		args << *itv;
    1.23  		++itv;
    1.24      }
    1.25  	
    1.26 -	xsltProc->addArgument ("--output");
    1.27 -	xsltProc->addArgument (outputFile);
    1.28 -	xsltProc->addArgument (xslFile);
    1.29 -	xsltProc->addArgument (inputFile);
    1.30 -	dia.append ("vym is executing: \n" + xsltProc->arguments().join(" ") );	
    1.31 -	if (!xsltProc->start() )
    1.32 +	args << "--output";
    1.33 +	args << outputFile;
    1.34 +	args << xslFile;
    1.35 +	args << inputFile;
    1.36 +	dia.append ("vym is executing: \n" + xsltprocessor+" "+args.join(" ") );	
    1.37 +	xsltProc->start(xsltprocessor,args);
    1.38 +	if (!xsltProc->waitForStarted() )
    1.39  	{
    1.40  		QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
    1.41  					   QObject::tr("Could not start %1").arg(xsltprocessor) );
    1.42  	} else
    1.43  	{
    1.44  		xsltProc->waitFinished();
    1.45 -		if (!xsltProc->normalExit() )
    1.46 +		if (xsltProc->exitStatus()!=QProcess::NormalExit )
    1.47  			QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
    1.48  			   QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
    1.49  			   xsltProc->getErrout() );