Skip to content

Commit

Permalink
Close root folder if externally deleted or renamed (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Dec 17, 2023
1 parent cadc14e commit 50f50a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/FolderManager/FolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace Scratch.FolderManager {
has_dummy = false;
}

private void on_changed (GLib.File source, GLib.File? dest, GLib.FileMonitorEvent event) {
protected virtual void on_changed (GLib.File source, GLib.File? dest, GLib.FileMonitorEvent event) {
if (source.get_basename ().has_prefix (".goutputstream")) {
return; // Ignore changes due to temp files and streams
}
Expand Down
8 changes: 8 additions & 0 deletions src/FolderManager/ProjectFolderItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ namespace Scratch.FolderManager {
}
}

protected override void on_changed (GLib.File source, GLib.File? dest, GLib.FileMonitorEvent event) {
if (source.equal (file.file) && event == DELETED) {
closed ();
} else {
base.on_changed (source, dest, event);
}
}

public void child_folder_changed (FolderItem folder) {
if (monitored_repo != null) {
monitored_repo.update_status_map ();
Expand Down

0 comments on commit 50f50a9

Please sign in to comment.