Ignore:
Timestamp:
Jan 8, 2014, 12:32:55 PM (11 years ago)
Author:
s10k
Message:

Vago 09

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Vago/trunk/Vago/converter.cpp

    r815 r897  
    1010void Converter::run()
    1111{
    12     QProcess *myProcess = new QProcess();
     12    this->processHasKilled=false;
     13    this->myProcess = new QProcess();
    1314    QString result = QString();
    1415    QString errorMessage = "";
    1516    int numErrors=0;
    1617
    17     myProcess->setWorkingDirectory(this->AppDir);
     18    myProcess->setWorkingDirectory(this->AppDir); // Set working directory (for work with AEI2/Mac OS)
    1819
    1920    if(this->myData->size()!=1){
     
    2324        emit setupPB(0); //Intermitent bar, we don't have any estimation when the task is done
    2425    }
    25 
    26     //myProcess->setProcessChannelMode(QProcess::MergedChannels); //we want both stdout and stderr
    2726
    2827    for(int i=0; i<this->myData->size(); i++){
     
    3736
    3837            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();
    4249
    4350            if(!result.isEmpty()){ //if(!result.startsWith("Importing",Qt::CaseSensitive) && !result.startsWith("Importing",Qt::CaseSensitive)){ //case sensitive is faster
     
    5764    }
    5865
    59     delete myProcess; //delete object and make pointer invalid
     66    delete this->myProcess; //delete object and make pointer invalid
    6067    this->myData->clear(); //clean list
    6168
     
    7178}
    7279
     80// Kill the process if requested
     81void 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.