summaryrefslogtreecommitdiff
path: root/src/nautilus-window-manage-views.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2006-02-27 14:52:58 +0000
committerAlexander Larsson <alexl@src.gnome.org>2006-02-27 14:52:58 +0000
commit3ca224bdc680b77a364985c8924126c0a87b542c (patch)
tree205f6e9efe7f6385f5e187a504587b3adeebb9b5 /src/nautilus-window-manage-views.c
parent0ac7625ab97727b77c975162f5227f59bd1a7bb8 (diff)
downloadnautilus-3ca224bdc680b77a364985c8924126c0a87b542c.tar.gz
Don't close window if old file changed when we're loading a new one
2006-02-27 Alexander Larsson <alexl@redhat.com> * src/nautilus-window-manage-views.c: Don't close window if old file changed when we're loading a new one (#137027). Based on patch from Christian Neumair.
Diffstat (limited to 'src/nautilus-window-manage-views.c')
-rw-r--r--src/nautilus-window-manage-views.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index db19a56d6..63f389d83 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -757,7 +757,11 @@ begin_location_change (NautilusWindow *window,
window->details->determine_view_file = nautilus_file_get (location);
g_assert (window->details->determine_view_file != NULL);
-
+
+ /* if the currently viewed file is marked gone while loading the new location,
+ * this ensures that the window isn't destroyed */
+ cancel_viewed_file_changed_callback (window);
+
nautilus_file_call_when_ready (window->details->determine_view_file,
NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY |
NAUTILUS_FILE_ATTRIBUTE_MIME_TYPE |
@@ -849,6 +853,7 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
char *view_id;
char *mimetype;
NautilusWindow *window;
+ NautilusFile *viewed_file;
char *location;
char *home_uri;
@@ -947,6 +952,13 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
} else {
/* Clean up state of already-showing window */
end_location_change (window);
+
+ /* We disconnected this, so we need to re-connect it */
+ viewed_file = nautilus_file_get (window->details->location);
+ nautilus_file_monitor_add (viewed_file, &window->details->viewed_file, 0);
+ g_signal_connect_object (viewed_file, "changed",
+ G_CALLBACK (viewed_file_changed_callback), window, 0);
+ nautilus_file_unref (viewed_file);
/* Leave the location bar showing the bad location that the user
* typed (or maybe achieved by dragging or something). Many times