[gtk+/gtk-2.90] Don't count the "enter directory name" line as a selected file



commit 3474971adb0981b65d9a5fb7125d5c91037c25a2
Author: Benjamin Otte <otte gnome org>
Date:   Wed Jun 24 22:46:21 2009 +0200

    Don't count the "enter directory name" line as a selected file

 gtk/gtkfilechooserdefault.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 63f9ea5..2a7bdf8 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -2733,14 +2733,21 @@ selection_check_foreach_cb (GtkTreeModel *model,
 {
   struct selection_check_closure *closure;
   gboolean is_folder;
-
-  closure = data;
-  closure->num_selected++;
+  GFile *file;
 
   gtk_tree_model_get (model, iter,
+                      MODEL_COL_FILE, &file,
                       MODEL_COL_IS_FOLDER, &is_folder,
                       -1);
 
+  if (file == NULL)
+    return;
+
+  g_object_unref (file);
+
+  closure = data;
+  closure->num_selected++;
+
   closure->all_folders = closure->all_folders && is_folder;
   closure->all_files = closure->all_files && !is_folder;
 }



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