]> Pileus Git - ~andy/gtk/commitdiff
GtkFileChooserEntry: handle slow folders by not autocompleting when the cursor is...
authorFederico Mena Quintero <federico@novell.com>
Fri, 23 Jan 2009 01:52:36 +0000 (01:52 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Fri, 23 Jan 2009 01:52:36 +0000 (01:52 +0000)
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

ChangeLog
gtk/gtkfilechooserentry.c

index 904c25806d46d18f07971b8c450ab1390c6aaa60..3cfdd98fd2aae81120a2c1d237745a1fa7de5bc6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
 2008-01-22  Matthias Clasen  <mnclasen@redhat.com>
 
        * gtk/gtkaction.c: Revert the last change, since it breaks
index 36c405524b4a062ccdd90bb0955c236a5384f83a..bb8b0511c4e7e48aea9a2af433672afb1744c7bc 100644 (file)
@@ -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);
 }