cola.models.gitrepo – Git repo model

Provides a QStandardItemModel-derived model usable by standrad Qt item view widgets.

class cola.models.gitrepo.Columns

Defines columns in the classic view

class cola.models.gitrepo.GitRepoEntry(path)

Provides asynchronous lookup of repository data for a path.

Emits signal names matching those defined in Columns.

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)

Return a static instance of a GitRepoEntry.

class cola.models.gitrepo.GitRepoInfoEvent(signal, *data)

Transport mechanism for communicating from a GitRepoInfoTask.

type()
class cola.models.gitrepo.GitRepoInfoTask(path)

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(column, path)

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.

class cola.models.gitrepo.GitRepoModel(parent)

Provides an interface into a git repository for browsing purposes.

add_directory(parent, path)

Add a directory entry to the model.

add_file(path, insert=False)

Add a file to the model.

entry(path)

Return the GitRepoEntry for a path.

path_is_interesting(path)

Return True if path has a status.

class cola.models.gitrepo.GitRepoNameItem(path)

Subclass GitRepoItem to provide a custom type().

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.

Previous topic

cola.models.main – Main application model

Next topic

cola.models.observable – Observable base class

This Page