[gtk+/gtk-2-24] filesystemmodel: Add a missing check



commit 0f4e67df6829d8846100221f5dd01de907776d59
Author: Benjamin Otte <otte redhat com>
Date:   Sun Oct 2 05:27:41 2011 +0200

    filesystemmodel: Add a missing check
    
    Paths with depth > 1 should return FALSE instead of pretending the depth
    is 1.

 gtk/gtkfilesystemmodel.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 1ba14d3..a673b13 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -513,6 +513,9 @@ gtk_file_system_model_get_iter (GtkTreeModel *tree_model,
 {
   g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
 
+  if (gtk_tree_path_get_depth (path) > 1)
+    return FALSE;
+
   return gtk_file_system_model_iter_nth_child (tree_model, 
                                                iter,
                                                NULL, 


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