Don't keep compiling/run if something failed.
[kdevelopdvcssupport.git] / plugins / cvs / logview.h
blobacd909927c85823101b0f897b4c23df88c0a151a
1 /***************************************************************************
2 * Copyright 2007 Robert Gruber <rgruber@users.sourceforge.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 ***************************************************************************/
11 #ifndef LOGVIEW_H
12 #define LOGVIEW_H
14 #include <QDialog>
15 #include <KJob>
17 #include "ui_logview.h"
19 class CvsPlugin;
20 class CvsJob;
23 /**
24 * This is a helper class for the LogView::parseOutput() method.
25 * It holds information about a single revision of a file.
26 * @see LogView::parseOutput()
28 class CvsRevision {
29 public:
30 QString revision;
31 QString date;
32 QString user;
33 QString log;
36 /**
37 * Shows the output from @code cvs log @endcode in a nice way.
38 * Create a CvsJob by calling CvsProxy::log() and connect the job's
39 * result(KJob*) signal to LogView::slotJobFinished(KJob* job)
40 * @author Robert Gruber <rgruber@users.sourceforge.net>
42 class LogView : public QWidget, private Ui::LogViewBase
44 Q_OBJECT
45 public:
46 explicit LogView(CvsPlugin* plugin, CvsJob* job=0, QWidget *parent = 0);
47 virtual ~LogView();
49 /**
50 * Parses the output generated by a @code cvs log @endcode command and
51 * fills the given QList with all revision infos found in the given output.
52 * @param jobOutput Pass in the plain output of a @code cvs log @endcode job
53 * @param revisions Will be filled with all revision infos found in @p jobOutput
55 static void parseOutput(const QString& jobOutput,
56 QList<CvsRevision>& revisions);
58 private slots:
59 /**
60 * Connect a job's result() signal to this slot. When called, the output from the job
61 * will be passed to the parseOutput() method and all found revisions will be displayed.
62 * @note If you pass a CvsJob object to the ctor, it's result() signal
63 * will automatically be connected to this slot.
65 void slotJobFinished(KJob* job);
67 private:
68 CvsPlugin* m_plugin;
69 QString m_output;
72 #endif