void GitRunner::startJob(DvcsJob &job) { m_result.clear(); m_isRunning = true; job.start(); m_result.append(job.output()); // Save the result m_isRunning = false; m_jobStatus = job.status(); // Save job status job.cancel(); // Kill the job delete &job; }
QString GitRunner::execSynchronously(const QStringList& command) { KJob *job = initJob(command); QString result; if (!job->exec()) { handleError(job); return QString(); } else { DvcsJob *j = qobject_cast<DvcsJob*>(job); if (!j) { return QString(); } result = j->output(); } return result; }
void GitRunner::initJob(DvcsJob &job) { job.setCommunicationMode(m_commMode); job.setDirectory(QDir(m_lastRepoRoot->pathOrUrl())); job << "git"; }