[PATCH] make text in "Open Location" dialog from Desktop friendlier



On HEAD if you type ctrl-l on the Desktop, the location entry is filled
in with x-nautilus-desktop:// which is not supposed to be exposed to the
user. The attached patch special cases the location dialog being created
from the Desktop so that the normal filesystem path for the Desktop is
used instead.
Index: src/nautilus-location-dialog.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-location-dialog.c,v
retrieving revision 1.7
diff -u -r1.7 nautilus-location-dialog.c
--- src/nautilus-location-dialog.c	22 Nov 2004 15:24:37 -0000	1.7
+++ src/nautilus-location-dialog.c	27 Nov 2004 11:25:12 -0000
@@ -29,7 +29,9 @@
 #include <gtk/gtkhbox.h>
 #include <gtk/gtklabel.h>
 #include <gtk/gtkstock.h>
+#include <libnautilus-private/nautilus-file-utilities.h>
 #include "nautilus-location-entry.h"
+#include "nautilus-desktop-window.h"
 
 struct _NautilusLocationDialogDetails {
 	GtkWidget *entry;
@@ -198,7 +200,11 @@
 
 	location = nautilus_window_get_location (window);
 	if (location != NULL) {
-		formatted_location = eel_format_uri_for_display (location);
+		if(NAUTILUS_IS_DESKTOP_WINDOW (window)) {
+			formatted_location = nautilus_get_desktop_directory ();
+		} else {
+			formatted_location = eel_format_uri_for_display (location);
+		}
 		nautilus_entry_set_text (NAUTILUS_ENTRY (NAUTILUS_LOCATION_DIALOG (dialog)->details->entry), formatted_location);
 		gtk_editable_select_region (GTK_EDITABLE (NAUTILUS_LOCATION_DIALOG (dialog)->details->entry), 0, -1);
 		gtk_editable_set_position (GTK_EDITABLE (NAUTILUS_LOCATION_DIALOG (dialog)->details->entry), -1);


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