[gtk+/multiroot-filechooser: 10/15] Validate the results in gtk_file_chooser_get_files.



commit a1c17ac0a456cf1c7f9415fd7390313e34d57d5a
Author: Christian Hammond <chipx86 chipx86 com>
Date:   Tue Mar 9 16:07:18 2010 -0800

    Validate the results in gtk_file_chooser_get_files.

 gtk/gtkfilechooser.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index a674ac3..db02215 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -1814,9 +1814,21 @@ gtk_file_chooser_unselect_file (GtkFileChooser *chooser,
 GSList *
 gtk_file_chooser_get_files (GtkFileChooser *chooser)
 {
+  GSList *files, *l;
+
   g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), NULL);
 
-  return GTK_FILE_CHOOSER_GET_IFACE (chooser)->get_files (chooser);
+  files = GTK_FILE_CHOOSER_GET_IFACE (chooser)->get_files (chooser);
+
+  for (l = files; l != NULL; l = l->next)
+    {
+      GFile *file = (GFile *)l->data;
+
+      g_return_val_if_fail (_gtk_file_chooser_is_file_in_root (chooser, file),
+                            NULL);
+    }
+
+  return files;
 }
 
 /**



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