cola.models.gitrepo – Git repo model
Provides a QStandardItemModel-derived model usable by standrad Qt
item view widgets.
-
class cola.models.gitrepo.GitRepoEntry(path, app_model)
Provides asynchronous lookup of repository data for a path.
- Emits the following Qt Signals:
- name(QString)
status(QString)
age(QString)
message(QString)
who(QString)
-
event(e)
- Receive GitRepoInfoEvents and emit corresponding Qt signals.
-
update()
- Starts a GitRepoInfoTask to calculate info for entries.
-
update_name()
- Emits a signal corresponding to the entry’s name.
-
class cola.models.gitrepo.GitRepoEntryManager
Provides access to static instances of GitRepoEntry and model data.
-
classmethod entry(path, app_model)
- Return a static instance of a GitRepoEntry.
-
class cola.models.gitrepo.GitRepoInfoEvent(*data)
- Transport mechanism for communicating from a GitRepoInfoTask.
-
class cola.models.gitrepo.GitRepoInfoTask(entry, path, app_model)
Handles expensive git lookups for a path.
-
data(key)
Return git data for a path.
Supported keys are ‘date’, ‘message’, and ‘author’
-
date()
Returns a relative date for a file path.
This is typically used for new entries that do not have
‘git log’ information.
-
name()
- Calculate the name for an entry.
-
run()
- Perform expensive lookups and post corresponding events.
-
status()
- Return the status for the entry’s path.
-
class cola.models.gitrepo.GitRepoItem(path, app_model, signal)
Represents a cell in a treeview.
Many GitRepoItems map to a single repository path.
Each GitRepoItem manages a different cell in the tree view.
One is created for each column – Name, Status, Age, etc.
-
connect()
- Connect a signal from entry to our setText method.
-
type()
Indicate that this item is of a special user-defined type.
‘name’ is the only column that registers a user-defined type.
This is done to allow filtering out other columns when determining
which paths are selected.
-
class cola.models.gitrepo.GitRepoModel(parent, model)
Provides an interface into a git repository for browsing purposes.
-
add_directory(parent, path)
- Add a directory entry to the model.
-
add_file(parent, path)
- Add a file entry to the model.
-
entry(path)
- Return the GitRepoEntry for a path.
-
class cola.models.gitrepo.GitRepoSignals
Defines signal names used in thread communication.
A nice trick we use here is using the columns header as the
value for the class-variable constant.