[PATCH] correctly navigate to nautilus links



From bug 89444 [1]:

"If you drag a mounted volume icon from the nautilus desktop to a
Location bar of any nautilus window, Nautilus says it does not have an
appropriate viewer."

Proposed patch attached.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=89444

-- 
Christian Neumair <chris gnome-de org>
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.354
diff -u -p -r1.354 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	9 Jul 2005 20:09:28 -0000	1.354
+++ src/nautilus-window-manage-views.c	10 Jul 2005 17:49:41 -0000
@@ -690,6 +690,7 @@ begin_location_change (NautilusWindow *w
         NautilusFile *file;
 	gboolean force_reload;
         char *current_pos;
+	char *uri;
 
         g_assert (NAUTILUS_IS_WINDOW (window));
         g_assert (location != NULL);
@@ -715,7 +716,15 @@ begin_location_change (NautilusWindow *w
         
         window->details->pending_scroll_to = g_strdup (scroll_pos);
         
-        directory = nautilus_directory_get (location);
+	file = nautilus_file_get (location);
+	if (nautilus_file_is_nautilus_link (file)) {
+		uri = nautilus_file_get_activation_uri (file);
+		nautilus_file_unref (file);
+		file = nautilus_file_get (uri);
+		g_free (uri);
+	}
+
+	directory = nautilus_directory_get_for_file (file);
 
 	/* The code to force a reload is here because if we do it
 	 * after determining an initial view (in the components), then
@@ -731,9 +740,7 @@ begin_location_change (NautilusWindow *w
 
 	if (force_reload) {
 		nautilus_directory_force_reload (directory);
-		file = nautilus_directory_get_corresponding_file (directory);
 		nautilus_file_invalidate_all_attributes (file);
-		nautilus_file_unref (file);
 	}
 
         nautilus_directory_unref (directory);
@@ -748,7 +755,7 @@ begin_location_change (NautilusWindow *w
 
 	/* Get the info needed for view selection */
 	
-        window->details->determine_view_file = nautilus_file_get (location);
+        window->details->determine_view_file = file;
 
 	g_assert (window->details->determine_view_file != NULL);
 	

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]