Don't be fooled by the meager function count! This bug was/is a bitch.

2000-06-16  Seth Nickell  <seth@eazel.com>

	* src/nautilus-location-bar.c: (try_to_expand_path):
	Don't be fooled by the meager function count!
	This bug was/is a bitch. Added a gtk_widget_grab_focus call to the
	end of the function because *somewhere* in the above procedure
	the gtk focus is being fscked with. Will track the actual
	problem down later, but this will get it out of our hair so
	we can test things like unescaping code.
	Also changed from gtk_entry_get_text to gtk_editable_get_chars
	as the former is deprecated and Truly Evil (tm).
This commit is contained in:
Seth Nickell 2000-06-16 08:43:02 +00:00 committed by Seth Nickell
parent 4e90eb7b77
commit 6aebd92aad
2 changed files with 25 additions and 5 deletions

View file

@ -1,3 +1,15 @@
2000-06-16 Seth Nickell <seth@eazel.com>
* src/nautilus-location-bar.c: (try_to_expand_path):
Don't be fooled by the meager function count!
This bug was/is a bitch. Added a gtk_widget_grab_focus call to the
end of the function because *somewhere* in the above procedure
the gtk focus is being fscked with. Will track the actual
problem down later, but this will get it out of our hair so
we can test things like unescaping code.
Also changed from gtk_entry_get_text to gtk_editable_get_chars
as the former is deprecated and Truly Evil (tm).
2000-06-15 John Sullivan <sullivan@eazel.com>
Modernized some NautilusBookmark code that had been written

View file

@ -204,17 +204,19 @@ try_to_expand_path(GtkEditable *editable)
GnomeVFSURI *uri;
int base_length, current_path_length, offset;
const char *base_name;
char *current_path, *dir_name, *expand_text;
current_path = nautilus_make_uri_from_input(gtk_entry_get_text (GTK_ENTRY (editable)));
char *user_location, *current_path, *dir_name, *expand_text;
user_location = gtk_editable_get_chars (editable, 0, -1);
current_path = nautilus_make_uri_from_input (user_location);
if (!nautilus_str_has_prefix(current_path, "file://")) {
g_free(current_path);
return;
}
current_path_length = strlen(current_path);
offset = current_path_length - strlen(gtk_entry_get_text(GTK_ENTRY (editable)));
offset = current_path_length - strlen(user_location);
uri = gnome_vfs_uri_new(current_path);
@ -262,7 +264,13 @@ try_to_expand_path(GtkEditable *editable)
g_free(dir_name);
g_free(current_path);
g_free(user_location);
gnome_vfs_directory_list_destroy(list);
/* FIXME: for purposes of "doing it right" and our own edification we want to
be able to remove the following line...but this will work just fine for now.
The problem is that *some* mysterious piece of the above code seems to affecting
the focus */
gtk_widget_grab_focus(GTK_WIDGET(editable));
}