[gtk+/gtk-2-24] filechooser: Fix entry completion



commit 5fe689ace8a9eb71fba2f1c5a496aa8afc9eb74f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 29 18:58:12 2012 -0400

    filechooser: Fix entry completion
    
    Inserting the selected completion did not actually work. Oops.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673090

 gtk/gtkfilechooserentry.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 134fb03..b3e7c88 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -238,23 +238,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,
+                            0,
                             gtk_editable_get_position (GTK_EDITABLE (chooser_entry)));
+  pos = 0;
   gtk_editable_insert_text (GTK_EDITABLE (chooser_entry),
-                           path,
-                            0,
-                            NULL); 
+                            path,
+                            -1,
+                            &pos);
 
   g_free (path);
 


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