80 ChildPointerMap::const_iterator i =
childPointer_.find(index);
145 if (index.
column() == 0) {
147 if (role == DisplayRole) {
149 return object.name +
'/';
152 }
else if (role == DecorationRole) {
154 return static_cast<const char*
>(
"icons/git-blob.png");
156 return static_cast<const char*
>(
"icons/git-tree.png");
171 if (orientation ==
Horizontal && role == DisplayRole)
172 return static_cast<const char*
>(
"File");
ObjectId getCommitTree(const std::string &revision) const
Get the tree for a particular revision.
void setRepositoryPath(const std::string &repositoryPath)
Set the repository and load its 'master' revision.
WModelIndex createIndex(int row, int column, void *ptr) const
GitModel(Wt::WObject *parent=0)
Constructor.
::uint64_t internalId() const
Index usable as a key to a map, that identifies a child/row within a tree.
int getTreeId(int parentId, int childIndex) const
Get or allocate an id for a folder.
virtual boost::any data(const Wt::WModelIndex &index, int role=Wt::DisplayRole) const
Returns data.
Git git_
The git repository.
const Git::ObjectId & treeObject() const
Returns the SHA1 id for the git tree object.
virtual Signal & layoutAboutToBeChanged()
virtual int rowCount(const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns the row count.
static const int ContentsRole
The role which may be used on a file to retrieve its contents.
int index() const
Returns the child index within the parent folder.
void emit(A... args) const
virtual Signal & layoutChanged()
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
virtual Wt::WModelIndex parent(const Wt::WModelIndex &index) const
Returns the parent index.
Git::Object getObject(const Wt::WModelIndex &index) const
Get the Git::Object that corresponds to an index.
std::string catFile(const ObjectId &id) const
Return the raw contents of a git object.
virtual boost::any headerData(int section, Wt::Orientation orientation=Wt::Horizontal, int role=Wt::DisplayRole) const
Returns header data.
static const int FilePathRole
int parentId() const
Returns the parent id.
Object treeGetObject(const ObjectId &tree, int index) const
Get some info on a tree object.
std::vector< Tree > treeData_
List of folder objects.
void loadRevision(const std::string &revName)
Load a particular revision.
virtual Wt::WModelIndex index(int row, int column, const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns a child index.
virtual int columnCount(const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns the column count.
int treeSize(const ObjectId &tree) const
Return the number of objects inside a tree object.
Used to uniquely locate a folder within the folder hierarchy.
void setRepositoryPath(const std::string &repository)
Set the git repository path.