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;
211 #endif // GIT_MODEL_H_ Tree(int parentId, int index, const Git::ObjectId &object, int rowCount)
Constructor.
Index usable as a key to a map, that identifies a child/row within a tree.
Git git_
The git repository.
const Git::ObjectId & treeObject() const
Returns the SHA1 id for the git tree object.
int index() const
Returns the child index within the parent folder.
Git::ObjectId treeObject_
static const ItemDataRole FilePathRole
Git utility class for browsing git archives.
int rowCount() const
Returns the (cached) row count.
ChildIndex(int aParent, int anIndex)
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
std::map< ChildIndex, int > ChildPointerMap
static const ItemDataRole ContentsRole
The role which may be used on a file to retrieve its contents.
int parentId() const
Returns the parent id.
A model that retrieves revision trees from a git repository.
std::vector< Tree > treeData_
List of folder objects.
Used to uniquely locate a folder within the folder hierarchy.