diff options
author | Alexander Larsson <alexl@redhat.com> | 2006-03-03 13:42:24 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2006-03-03 13:42:24 +0000 |
commit | 6f8bff3e5db0bb21d1a83ed564f09cd5eee4a2dc (patch) | |
tree | a50dbf203bb3e3ae31445b731187a36935a4474b /src/nautilus-window-manage-views.c | |
parent | 48311728868235d95d5bacf45ed48437181d74d4 (diff) | |
download | nautilus-6f8bff3e5db0bb21d1a83ed564f09cd5eee4a2dc.tar.gz |
Close window when it gets put in the trash.
2006-03-03 Alexander Larsson <alexl@redhat.com>
* src/nautilus-window-manage-views.c:
* src/nautilus-window-private.h:
Close window when it gets put in the trash.
Patch from Christian Neumair
Diffstat (limited to 'src/nautilus-window-manage-views.c')
-rw-r--r-- | src/nautilus-window-manage-views.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index 63f389d83..f7404aa8f 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -296,6 +296,7 @@ viewed_file_changed_callback (NautilusFile *file, NautilusWindow *window) { char *new_location; + gboolean is_in_trash, was_in_trash; g_assert (NAUTILUS_IS_FILE (file)); g_assert (NAUTILUS_IS_WINDOW (window)); @@ -305,8 +306,12 @@ viewed_file_changed_callback (NautilusFile *file, window->details->viewed_file_seen = TRUE; } - /* Close window if the file it's viewing has been deleted. */ - if (nautilus_file_is_gone (file)) { + was_in_trash = window->details->viewed_file_in_trash; + + window->details->viewed_file_in_trash = is_in_trash = nautilus_file_is_in_trash (file); + + /* Close window if the file it's viewing has been deleted or moved to trash. */ + if (nautilus_file_is_gone (file) || (is_in_trash && !was_in_trash)) { /* Don't close the window in the case where the * file was never seen in the first place. */ @@ -1196,6 +1201,7 @@ update_for_new_location (NautilusWindow *window) file = nautilus_file_get (window->details->location); nautilus_window_set_viewed_file (window, file); window->details->viewed_file_seen = !nautilus_file_is_not_yet_confirmed (file); + window->details->viewed_file_in_trash = nautilus_file_is_in_trash (file); nautilus_file_monitor_add (file, &window->details->viewed_file, 0); g_signal_connect_object (file, "changed", G_CALLBACK (viewed_file_changed_callback), window, 0); |