gtk+ r22180 - in trunk: . gtk



Author: federico
Date: Fri Jan 23 00:54:08 2009
New Revision: 22180
URL: http://svn.gnome.org/viewvc/gtk+?rev=22180&view=rev

Log:
Process the result of refreshing the folder during autocompletion
	(start_autocompletion): Process the result from refresh...().  We
	only do completion in the REFRESH_OK case.  For the error cases,
	we don't do anything, as this is autocompletion and must not
	result in non-asked-for errors popping up.

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 00:54:08 2009
@@ -1584,21 +1584,34 @@
 static void
 start_autocompletion (GtkFileChooserEntry *chooser_entry)
 {
-  /* FMQ: get result from the function below */
-  refresh_current_folder_and_file_part (chooser_entry, REFRESH_UP_TO_CURSOR_POSITION);
+  RefreshStatus status;
 
-  if (!chooser_entry->current_folder)
+  status = refresh_current_folder_and_file_part (chooser_entry, REFRESH_UP_TO_CURSOR_POSITION);
+
+  switch (status)
     {
+    case REFRESH_OK:
+      g_assert (chooser_entry->current_folder_file != NULL);
+
+      if (chooser_entry->current_folder && _gtk_folder_is_finished_loading (chooser_entry->current_folder))
+	autocomplete (chooser_entry);
+      else
+	chooser_entry->load_complete_action = LOAD_COMPLETE_AUTOCOMPLETE;
+
+      break;
+
+    case REFRESH_INVALID_INPUT:
+    case REFRESH_INCOMPLETE_HOSTNAME:
+    case REFRESH_NONEXISTENT:
+    case REFRESH_NOT_LOCAL:
       /* We don't beep or anything, since this is autocompletion - the user
        * didn't request any action explicitly.
        */
-      return;
-    }
+      break;
 
-  if (_gtk_folder_is_finished_loading (chooser_entry->current_folder))
-    autocomplete (chooser_entry);
-  else
-    chooser_entry->load_complete_action = LOAD_COMPLETE_AUTOCOMPLETE;
+    default:
+      g_assert_not_reached ();
+    }
 }
 
 static gboolean



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