corrected creation of the command line under win

This commit is contained in:
Paolo Cignoni 2008-03-06 10:58:40 +00:00
parent 04d00284a5
commit fa857d5e51
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <QString> #include <QString>
#include <QProcess> #include <QProcess>
#include <vector> #include <vector>
#include <QMessageBox>
#include "export_idtf.h" #include "export_idtf.h"
#include<vcg/space/point3.h> #include<vcg/space/point3.h>
@ -107,12 +108,13 @@ private:
{ {
QProcess p; QProcess p;
QString convstring = par._converter_loc; QString convstring = par._converter_loc;
convstring = convstring + " -en1 -input " + par._input_file + " -output " + par._output_file; convstring = "\""+convstring + "\" -en 1 -input \"" + par._input_file + "\" -output \"" + par._output_file +"\"";
qDebug("Starting converter %s", qPrintable(convstring)); qDebug("Starting converter %s", qPrintable(convstring));
p.setProcessChannelMode(QProcess::MergedChannels); p.setProcessChannelMode(QProcess::MergedChannels);
p.start(convstring); p.start(convstring);
//wait until the task has been completed //wait until the task has been completed
bool t = p.waitForFinished(-1); bool t = p.waitForFinished(-1);
if(!t) QMessageBox::warning(0, QString("Saving Error"), QString("Failed conversion executable '%1'").arg(convstring));
p.close(); p.close();
return (int) t; return (int) t;
} }