This repository was archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWorkingTreeModel.h
More file actions
63 lines (52 loc) · 1.96 KB
/
WorkingTreeModel.h
File metadata and controls
63 lines (52 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* MacGitver
* Copyright (C) 2012 Sascha Cunz <sascha@babbelbox.org>
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License (Version 2) as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if
* not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MGV_WORKING_TREE_MODEL_H
#define MGV_WORKING_TREE_MODEL_H
#include <QAbstractItemModel>
#include "libGitWrap/Repository.hpp"
class WorkingTreeAbstractItem;
class WorkingTreeDirItem;
class WorkingTreeFileItem;
class WorkingTreeModel : public QAbstractItemModel
{
friend class WorkingTreeAbstractItem;
friend class WorkingTreeDirItem;
friend class WorkingTreeFileItem;
Q_OBJECT
public:
WorkingTreeModel( QObject* parent = 0 );
~WorkingTreeModel();
public:
const Git::Repository &repository() const;
void setRepository( Git::Repository repo );
WorkingTreeAbstractItem *indexToItem(const QModelIndex &index) const;
public:
QVariant data( const QModelIndex& index, int role ) const;
Qt::ItemFlags flags( const QModelIndex& index ) const;
QVariant headerData( int section, Qt::Orientation orientation,
int role = Qt::DisplayRole ) const;
QModelIndex index( int row, int column,
const QModelIndex& parent = QModelIndex() ) const;
QModelIndex parent( const QModelIndex& index ) const;
int rowCount( const QModelIndex& parent = QModelIndex() ) const;
int columnCount( const QModelIndex& parent = QModelIndex() ) const;
private:
void update();
private:
Git::Repository mRepo;
WorkingTreeDirItem* mRootItem;
};
#endif