Changeset 897 for Vago/trunk/Vago/converter.cpp
- Timestamp:
- Jan 8, 2014, 12:32:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Vago/trunk/Vago/converter.cpp
r815 r897 10 10 void Converter::run() 11 11 { 12 QProcess *myProcess = new QProcess(); 12 this->processHasKilled=false; 13 this->myProcess = new QProcess(); 13 14 QString result = QString(); 14 15 QString errorMessage = ""; 15 16 int numErrors=0; 16 17 17 myProcess->setWorkingDirectory(this->AppDir); 18 myProcess->setWorkingDirectory(this->AppDir); // Set working directory (for work with AEI2/Mac OS) 18 19 19 20 if(this->myData->size()!=1){ … … 23 24 emit setupPB(0); //Intermitent bar, we don't have any estimation when the task is done 24 25 } 25 26 //myProcess->setProcessChannelMode(QProcess::MergedChannels); //we want both stdout and stderr27 26 28 27 for(int i=0; i<this->myData->size(); i++){ … … 37 36 38 37 commandToExec=commands.mid(currentIndex,(nextIndex-currentIndex)); 39 myProcess->start(GlobalVars::OniSplitExeName+" "+commandToExec); 40 myProcess->waitForFinished(-1); 41 result=myProcess->readAllStandardError(); 38 this->myProcess->start(GlobalVars::OniSplitExeName+" "+commandToExec); 39 this->myProcess->waitForFinished(-1); 40 41 if(this->processHasKilled){ // If the process has killed there's no need to proceed with reading output or process more commands 42 delete this->myProcess; //delete object and make pointer invalid 43 this->myData->clear(); //clean list 44 emit conversionAborted(); 45 return; 46 } 47 48 result=this->myProcess->readAllStandardError(); 42 49 43 50 if(!result.isEmpty()){ //if(!result.startsWith("Importing",Qt::CaseSensitive) && !result.startsWith("Importing",Qt::CaseSensitive)){ //case sensitive is faster … … 57 64 } 58 65 59 delete myProcess; //delete object and make pointer invalid66 delete this->myProcess; //delete object and make pointer invalid 60 67 this->myData->clear(); //clean list 61 68 … … 71 78 } 72 79 80 // Kill the process if requested 81 void Converter::terminateCurrProcess(){ 82 this->myProcess->kill(); 83 this->processHasKilled=true; 84 this->myLogger->writeString("Received signal to kill current OniSplit operation (user requested)."); 85 }
Note:
See TracChangeset
for help on using the changeset viewer.