insilmaril@823: #include "bugagent.h" insilmaril@823: insilmaril@823: #include "branchitem.h" insilmaril@823: #include "mainwindow.h" insilmaril@823: #include "vymmodel.h" insilmaril@823: insilmaril@823: extern Main *mainWindow; insilmaril@823: insilmaril@823: BugAgent::BugAgent (BranchItem *bi,const QString &bug) insilmaril@823: { insilmaril@823: if (!bi) insilmaril@823: { insilmaril@823: qWarning ("Const BugAgent: bi==NULL"); insilmaril@823: return; insilmaril@823: } insilmaril@823: branchID=bi->getID(); insilmaril@823: modelID=bi->getModel()->getID(); insilmaril@823: bugID=bug; insilmaril@823: insilmaril@823: script="test/vym-bug.pl"; insilmaril@823: insilmaril@823: p=new Process; insilmaril@823: insilmaril@823: connect (p, SIGNAL (finished(int,QProcess::ExitStatus) ), insilmaril@823: this, SLOT (processFinished(int,QProcess::ExitStatus) )); insilmaril@823: insilmaril@823: p->start (script,QStringList()<waitForStarted()) insilmaril@823: { insilmaril@823: qWarning()<<"BugAgent::getBugzillaData couldn't start "<getModel (modelID); insilmaril@823: if (model) insilmaril@823: { insilmaril@823: BranchItem *bi=(BranchItem*)(model->findID (branchID)); insilmaril@823: if (bi) insilmaril@823: { insilmaril@823: QString oldsel=model->getSelectString (); insilmaril@823: model->select (bi); insilmaril@823: insilmaril@823: // Now do needed changes: insilmaril@823: insilmaril@823: QString result=p->getStdout(); insilmaril@823: while (result.endsWith("\n")) result.chop(1); insilmaril@823: //qWarning() << QString(result); insilmaril@823: QString err=p->getErrout(); insilmaril@823: if (!err.isEmpty()) insilmaril@823: { insilmaril@823: qWarning() << "VM::BugAgent Error:\n"; insilmaril@823: qWarning() <setHeading (bugID + " - " + heading); insilmaril@823: qDebug() << "VM: heading="<select (oldsel); insilmaril@823: } else insilmaril@823: qWarning ()<<"BugAgent: Found model, but not branch #"<