summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2006-03-03 13:42:24 +0000
committerAlexander Larsson <alexl@src.gnome.org>2006-03-03 13:42:24 +0000
commit6f8bff3e5db0bb21d1a83ed564f09cd5eee4a2dc (patch)
treea50dbf203bb3e3ae31445b731187a36935a4474b /src
parent48311728868235d95d5bacf45ed48437181d74d4 (diff)
downloadnautilus-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')
-rw-r--r--src/nautilus-window-manage-views.c10
-rw-r--r--src/nautilus-window-private.h1
2 files changed, 9 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);
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 45e2242d0..5b51a925c 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -72,6 +72,7 @@ struct NautilusWindowDetails
char *title;
NautilusFile *viewed_file;
gboolean viewed_file_seen;
+ gboolean viewed_file_in_trash;
gboolean allow_stop;
/* New location. */