/*************************************************************************** * Copyright 2008 Robert Gruber * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "cvslogjob.h" #include #include #include #include #include CvsLogJob::CvsLogJob(KDevelop::IPlugin* parent, KDevelop::OutputJob::OutputJobVerbosity verbosity) : CvsJob(parent, verbosity) { } CvsLogJob::~CvsLogJob() { } QVariant CvsLogJob::fetchResults() { // Convert job's output into KDevelop::VcsEvent QList events; parseOutput(output(), events); return events; } void CvsLogJob::parseOutput(const QString& jobOutput, QList& events) { static QRegExp rx_sep( "[-=]+" ); static QRegExp rx_rev( "revision ((\\d+\\.?)+)" ); static QRegExp rx_branch( "branches:\\s+(.*)" ); static QRegExp rx_date( "date:\\s+([^;]*);\\s+author:\\s+([^;]*).*" ); QStringList lines = jobOutput.split('\n'); KDevelop::VcsEvent item; bool firstSeperatorReached = false; QString log; for (int i=0; i