filechooser: Fix entry completion

Inserting the selected completion did not actually work. Oops.

https://bugzilla.gnome.org/show_bug.cgi?id=673090
This commit is contained in:
Matthias Clasen 2012-03-29 18:58:12 -04:00
parent 71a82b1e98
commit d51840ccf3

View File

@ -233,23 +233,25 @@ gtk_file_chooser_entry_dispose (GObject *object)
/* Match functions for the GtkEntryCompletion */
static gboolean
match_selected_callback (GtkEntryCompletion *completion,
GtkTreeModel *model,
GtkTreeIter *iter,
GtkFileChooserEntry *chooser_entry)
GtkTreeModel *model,
GtkTreeIter *iter,
GtkFileChooserEntry *chooser_entry)
{
char *path;
gint pos;
gtk_tree_model_get (model, iter,
FULL_PATH_COLUMN, &path,
FULL_PATH_COLUMN, &path,
-1);
gtk_editable_delete_text (GTK_EDITABLE (chooser_entry),
0,
gtk_editable_get_position (GTK_EDITABLE (chooser_entry)));
gtk_editable_insert_text (GTK_EDITABLE (chooser_entry),
path,
0,
NULL);
gtk_editable_get_position (GTK_EDITABLE (chooser_entry)));
pos = 0;
gtk_editable_insert_text (GTK_EDITABLE (chooser_entry),
path,
-1,
&pos);
g_free (path);