diff options
author | Federico Mena Quintero <federico@novell.com> | 2009-01-23 01:52:36 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2009-01-23 01:52:36 +0000 |
commit | ba54644c3874e2fa8d8429883479a34d3e351285 (patch) | |
tree | 7854fe05e995deeda22a445baabc79cee35ccd30 /gtk/gtkfilechooserentry.c | |
parent | 0b2554da86cbdc09686363b3ecd2208365402540 (diff) | |
download | gtk+-ba54644c3874e2fa8d8429883479a34d3e351285.tar.gz |
GtkFileChooserEntry: handle slow folders by not autocompleting when the cursor is not at the end of the text
2009-01-22 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserentry.c (autocomplete): Relax the assertion;
just do nothing if the folder is not loaded or if the cursor position
is not at the end of the text. A very slow-to-load folder can get
us into the latter state if the user starts typing first.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=22186
Diffstat (limited to 'gtk/gtkfilechooserentry.c')
-rw-r--r-- | gtk/gtkfilechooserentry.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 36c405524b..bb8b0511c4 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -1630,9 +1630,10 @@ refresh_current_folder_and_file_part (GtkFileChooserEntry *chooser_entry, static void autocomplete (GtkFileChooserEntry *chooser_entry) { - g_assert (chooser_entry->current_folder != NULL); - g_assert (_gtk_folder_is_finished_loading (chooser_entry->current_folder)); - g_assert (gtk_editable_get_position (GTK_EDITABLE (chooser_entry)) == GTK_ENTRY (chooser_entry)->text_length); + if (!(chooser_entry->current_folder != NULL + && _gtk_folder_is_finished_loading (chooser_entry->current_folder) + && gtk_editable_get_position (GTK_EDITABLE (chooser_entry)) == GTK_ENTRY (chooser_entry)->text_length)) + return; append_common_prefix (chooser_entry, TRUE, FALSE); } |