~neon/plasmate/frameworks

« back to all changes in this revision

Viewing changes to plasmate/plugins/savesystemview/commitsmodel.h

  • Committer: Giorgos Tsiapaliokas
  • Date: 2015-03-14 12:58:48 UTC
  • mfrom: (972.1.19)
  • Revision ID: git-v1:7b24cb2599e2bea0612cb492d2395bb6c44722ed
Merge branch 'review_savesystem_updated' into frameworks

REVIEW: 121206

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright 2014 Giorgos Tsiapaliokas <giorgos.tsiapaliokas@kde.org>
 
3
 
 
4
    This library is free software; you can redistribute it and/or
 
5
    modify it under the terms of the GNU Library General Public
 
6
    License as published by the Free Software Foundation; either
 
7
    version 2 of the License, or (at your option) any later version.
 
8
 
 
9
    This library is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
    Library General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU Library General Public License
 
15
    along with this library; see the file COPYING.LIB.  If not, write to
 
16
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
    Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef COMMITSMODEL_H
 
21
#define COMMITSMODEL_H
 
22
 
 
23
#include <QIdentityProxyModel>
 
24
#include <vcs/vcsevent.h>
 
25
 
 
26
class Git;
 
27
 
 
28
class CommitsModel : public QIdentityProxyModel
 
29
{
 
30
    Q_OBJECT
 
31
public:
 
32
    CommitsModel(Git* parent);
 
33
    ~CommitsModel();
 
34
 
 
35
    enum Roles {
 
36
        Author = Qt::UserRole + 1,
 
37
        Date,
 
38
        Message
 
39
    };
 
40
 
 
41
    QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override;
 
42
 
 
43
    QHash<int, QByteArray> roleNames() const override;
 
44
 
 
45
private:
 
46
    Git *m_git;
 
47
    QList<KDevelop::VcsEvent> m_commitsList;
 
48
};
 
49
 
 
50
#endif