10 #include <Wt/WAbstractItemModel.h>
52 void setRepositoryPath(
const std::string& repositoryPath);
59 void loadRevision(
const std::string& revName);
65 virtual WModelIndex parent(
const WModelIndex& index)
const;
71 virtual int columnCount(
const WModelIndex& parent = WModelIndex())
79 virtual int rowCount(
const WModelIndex& parent = WModelIndex())
const;
88 index(
int row,
int column,
const WModelIndex& parent = WModelIndex())
96 data(
const WModelIndex& index, ItemDataRole role = ItemDataRole::Display)
const;
101 headerData(
int section, Orientation orientation = Orientation::Horizontal,
102 ItemDataRole role = ItemDataRole::Display)
const;
104 using WAbstractItemModel::data;
119 : parentId(aParent), index(anIndex) { }
126 else return index < other.
index;
139 : index_(parentId, index),
154 int index()
const {
return index_.index; }
202 int getTreeId(
int parentId,
int childIndex)
const;
206 Git::Object getObject(
const WModelIndex& index)
const;
Used to uniquely locate a folder within the folder hierarchy.
Tree(int parentId, int index, const Git::ObjectId &object, int rowCount)
Constructor.
int parentId() const
Returns the parent id.
int index() const
Returns the child index within the parent folder.
int rowCount() const
Returns the (cached) row count.
const Git::ObjectId & treeObject() const
Returns the SHA1 id for the git tree object.
Git::ObjectId treeObject_
A model that retrieves revision trees from a git repository.
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
std::vector< Tree > treeData_
List of folder objects.
std::map< ChildIndex, int > ChildPointerMap
static const ItemDataRole ContentsRole
The role which may be used on a file to retrieve its contents.
static const ItemDataRole FilePathRole
Git git_
The git repository.
Git utility class for browsing git archives.
Index usable as a key to a map, that identifies a child/row within a tree.
ChildIndex(int aParent, int anIndex)