[PATCH] 47239 - Shouldn't expand ~ or ~/ until the user presses enter



? autocompletion-eel-patch2
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5264
diff -p -u -r1.5264 ChangeLog
--- ChangeLog	4 May 2002 14:55:46 -0000	1.5264
+++ ChangeLog	4 May 2002 22:42:53 -0000
@@ -1,3 +1,13 @@
+2002-05-04  David Emory Watson  <dwatson cs ucr edu>
+
+	* src/nautilus-location-bar.c:
+	(editable_event_after_callback): Don't expand ~ or ~/ until the user
+	presses enter, bug  47239.
+	(has_exactly_one_slash): Removed.
+
 2002-05-03  David Emory Watson  <dwatson cs ucr edu>
 
 	* src/nautilus-location-bar.c:
Index: src/nautilus-location-bar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-location-bar.c,v
retrieving revision 1.85
diff -p -u -r1.85 nautilus-location-bar.c
--- src/nautilus-location-bar.c	4 May 2002 14:55:48 -0000	1.85
+++ src/nautilus-location-bar.c	4 May 2002 22:42:54 -0000
 	return length;
 }
 
-static gboolean
-has_exactly_one_slash (GtkEditable *editable)
-{
-	char *text, *slash;
-	gboolean exactly_one;
-
-	text = gtk_editable_get_chars (editable, 0, -1);
-	slash = g_utf8_strchr (text, -1, '/');
-	exactly_one = slash != NULL && g_utf8_strchr (g_utf8_next_char (slash), -1, '/') == NULL;
-	g_free (text);
-
-	return exactly_one;
-}
-
 static void
 set_position_and_selection_to_end (GtkEditable *editable)
 {
@@ -572,8 +560,6 @@ editable_event_after_callback (GtkEntry 
 	GtkEditable *editable;
 	GdkEventKey *keyevent;
 	NautilusLocationBar *bar;
-	const char *unexpanded_text;
-	char *expanded_text;
 
 	if (event->type != GDK_KEY_PRESS) {
 		return;
@@ -604,16 +590,6 @@ editable_event_after_callback (GtkEntry 
 	 */
 	if (position_and_selection_are_at_end (editable)) {
 		if (entry_would_have_inserted_characters (keyevent)) {
-			if (keyevent->keyval == GDK_slash
-				&& has_exactly_one_slash (editable)) {
-				unexpanded_text = gtk_entry_get_text (GTK_ENTRY (editable));
-				expanded_text = gnome_vfs_expand_initial_tilde (unexpanded_text);
-				if (strcmp (unexpanded_text, expanded_text) != 0) {
-					gtk_entry_set_text (GTK_ENTRY (editable), expanded_text);
-					set_position_and_selection_to_end (editable);
-				}
-				g_free (expanded_text);
-			}
 			if (bar->details->idle_id == 0) {
 				bar->details->idle_id = gtk_idle_add (try_to_expand_path, bar);
 			}


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