summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserentry.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2009-01-23 00:54:08 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2009-01-23 00:54:08 +0000
commitfe636e4be20a0140f2b1b52ad66acaeb9537ac14 (patch)
treea0c7db21360d52053fcc841cb36dbe70c4e23faf /gtk/gtkfilechooserentry.c
parentc1205bbbb9a23b0e3b7693e95110403881b217d3 (diff)
downloadgtk+-fe636e4be20a0140f2b1b52ad66acaeb9537ac14.tar.gz
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> svn path=/trunk/; revision=22180
Diffstat (limited to 'gtk/gtkfilechooserentry.c')
-rw-r--r--gtk/gtkfilechooserentry.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 30dcb61385..de6adea7f7 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -1584,21 +1584,34 @@ autocomplete (GtkFileChooserEntry *chooser_entry)
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;
+
+ status = refresh_current_folder_and_file_part (chooser_entry, REFRESH_UP_TO_CURSOR_POSITION);
- if (!chooser_entry->current_folder)
+ 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