+static void
+update_inline_completion (GtkFileChooserEntry *chooser_entry)
+{
+ GtkEntryCompletion *completion = gtk_entry_get_completion (GTK_ENTRY (chooser_entry));
+
+ if (!chooser_entry->current_folder_loaded)
+ {
+ gtk_entry_completion_set_inline_completion (completion, FALSE);
+ return;
+ }
+
+ switch (chooser_entry->action)
+ {
+ case GTK_FILE_CHOOSER_ACTION_OPEN:
+ case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
+ gtk_entry_completion_set_inline_completion (completion, TRUE);
+ break;
+ case GTK_FILE_CHOOSER_ACTION_SAVE:
+ case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
+ gtk_entry_completion_set_inline_completion (completion, FALSE);
+ break;
+ }
+}
+