ProjectManager
Object Hierarchy:
Description:
public class ProjectManager : Object
Central coordinator for all file system operations.
ProjectManager is the entry point for all file system operations. It manages file cache, tracks active project and active file, provides
buffer and git providers, handles database persistence, and emits signals for state changes.
The file_cache provides O(1) lookup by path. Projects are folders with is_project = true (no separate Project class). Database operations
are optional (can work without database).
Content:
Properties:
Creation methods:
Methods:
- public void activate_file (File? file)
Activate a file (deactivates previous active file).
- public async void activate_project (Folder? project)
Activate a project (deactivates previous active project). Note:
Projects are Folders with is_project = true.
- public async FileUpdateStatus check_active_file_changed ()
Check if the active file has been modified on disk and differs from
the buffer.
- public async void convert_fake_file_to_real (File file, string file_path) throws Error
Converts a fake file (id = -1) to a real File object if it's within
the active project.
- public Folder create_project (string path)
Ensure a project exists at the given path. Caller must have verified
the path is not already a project (path_map). If we have a Folder at this path (folder_map or DB), promote it; otherwise create new.
- public File? get_file_from_active_project (string file_path)
Check if a file path is in the active project.
- public Folder? get_folder_at_path (string path)
Find a Folder at the given path (e.g. subfolder of a project, or in
DB). Caller must have already verified the path is not already a project (path_map). Checks each project's folder_map, then the
database. Does not check path_map or file_cache.
- public async void load_projects_from_db ()
Load projects from database.
- public void notify_project_changed (Folder project)
Notify that a project's state has changed (save to database). Note:
Projects are Folders with is_project = true.
- public void on_file_contents_change (File file)
Notify that a file's content has changed (save to database and emit
signal).
- public void on_file_metadata_change (File file)
Notify that a file's metadata has changed (save to database and emit
signal).
- public async void reload_file_from_disk ()
Reloads active file from disk into buffer, discarding unsaved changes.
- public void remove_project (Folder project)
Remove a project from the projects list by clearing the is_project
flag. Does not delete any filebase or file_history data.
- public async void restore_active_state ()
Restore active project and file from in-memory data structures. Note:
Projects are Folders with is_project = true. This will set this.active_project and this.active_file, deactivate previous items, update
the database, and emit signals.
- public Tree tree_factory (File file)
Get or create a Tree instance for the given file.
- public async void write_buffer_to_disk ()
Writes current buffer contents of active file to disk.
Signals:
- public signal void active_file_changed (File? file)
Emitted when active file changes.
- public signal void active_project_changed (Folder? project)
Emitted when active project changes. Note: Projects are Folders with
is_project = true.
- public signal void file_contents_changed (File file)
Emitted when file content changes (saved, edited, etc.). This signal
is emitted when file content is written to disk and triggers background scanning.
- public signal void file_metadata_changed (File file)
Emitted when file metadata changes (cursor, scroll, last_viewed,
etc.). This signal is emitted for metadata-only updates that don't require background scanning.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref