FilesRootModel
The folders of the Files tab switcher: the checkout of a project, then each of its worktrees.
| Inherits | QAbstractListModel |
| Group | libtrove |
In the namespace octomy::trove::workspace. Declared in src/libs/libtrove/trove/workspace/FilesRootModel.hpp.
Detailed description
trove-spec-workspace §SW-6 and §SW-10.3: the Files tab is a switcher across the canonical checkout and each lane worktree. "What did the session change?" has no answer in the checkout alone.
The first row is the checkout. It is read-only, because Trove made it and can delete it when the project is discarded. The rows after it are the worktrees that worktree.list returns, in its order. Each one is editable, because a session's changes are there. FilesRoot::isWritable() states the rule, and FilesWorkspace applies it to the file manager.
The model reads no git itself. listWorktrees() runs the worktree.list task object over the bindings of the host, the same task that a session calls through the door, and setWorktreeList() reads its output. A widget runs listWorktrees() off the GUI thread, because it starts git.
See also FilesRoot, FilesWorkspace, octomy::trove::opal::WorktreeListTask.