diff -r c2ce9944148c -r 0bba81dde1bc bugagent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bugagent.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -0,0 +1,127 @@ +#include "bugagent.h" + +#include "branchitem.h" +#include "mainwindow.h" +#include "vymmodel.h" + +extern Main *mainWindow; + +BugAgent::BugAgent (BranchItem *bi,const QString &bug) +{ + if (!bi) + { + qWarning ("Const BugAgent: bi==NULL"); + return; + } + branchID=bi->getID(); + modelID=bi->getModel()->getID(); + bugID=bug; + + script="test/vym-bug.pl"; + + p=new Process; + + connect (p, SIGNAL (finished(int,QProcess::ExitStatus) ), + this, SLOT (processFinished(int,QProcess::ExitStatus) )); + + p->start (script,QStringList()<waitForStarted()) + { + qWarning()<<"BugAgent::getBugzillaData couldn't start "<getModel (modelID); + if (model) + { + BranchItem *bi=(BranchItem*)(model->findID (branchID)); + if (bi) + { + QString oldsel=model->getSelectString (); + model->select (bi); + + // Now do needed changes: + + QString result=p->getStdout(); + while (result.endsWith("\n")) result.chop(1); + //qWarning() << QString(result); + QString err=p->getErrout(); + if (!err.isEmpty()) + { + qWarning() << "VM::BugAgent Error:\n"; + qWarning() <setHeading (bugID + " - " + heading); + qDebug() << "VM: heading="<select (oldsel); + } else + qWarning ()<<"BugAgent: Found model, but not branch #"<