#include "externalexecuter.h"


ExternalExecuter::ExternalExecuter()
{

}

ExternalExecuter::~ExternalExecuter()
{

}

void ExternalExecuter::CallApp()
{
    QProcess myProcess(this);
    QStringList args;
    args << "1";

    myProcess.start(programPath,args);
    myProcess.waitForFinished(-1);
}

bool ExternalExecuter::FindApp()
{
    QString localPath = QDir::currentPath() + "/Application";
    QDirIterator iterator(localPath,QDirIterator::Subdirectories);

    while(iterator.hasNext()){
        iterator.next();

        if(iterator.fileInfo().fileName() == "RRJ.exe"){
            programPath = iterator.fileInfo().absoluteFilePath();
            return true;
        }
    }

    return false;
}
