gtk+ r22186 - in trunk: . gtk



Author: federico
Date: Fri Jan 23 01:52:36 2009
New Revision: 22186
URL: http://svn.gnome.org/viewvc/gtk+?rev=22186&view=rev

Log:
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>

Modified:
   trunk/ChangeLog
   trunk/gtk/gtkfilechooserentry.c

Modified: trunk/gtk/gtkfilechooserentry.c
==============================================================================
--- trunk/gtk/gtkfilechooserentry.c	(original)
+++ trunk/gtk/gtkfilechooserentry.c	Fri Jan 23 01:52:36 2009
@@ -1630,9 +1630,10 @@
 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);
 }



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