[gtk+/filesystemmodel] don't count the "enter directory name" line as a selected file



commit 5aa63d44662892680d358a13aaac6bf8cf667542
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 da72612..d3b4b78 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -2695,14 +2695,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]