[libgd] view: Handle selection for tree stores as well



commit a7a628884449e48af5bd6d1cf8d7b76cb4beff9f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 14 15:30:26 2014 +0100

    view: Handle selection for tree stores as well
    
    We only supported list stores, but the rest of the widget supports
    tree stores just as well.

 libgd/gd-main-view.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/libgd/gd-main-view.c b/libgd/gd-main-view.c
index 8670476..73bd70a 100644
--- a/libgd/gd-main-view.c
+++ b/libgd/gd-main-view.c
@@ -355,9 +355,18 @@ do_select_row (GdMainView *self,
       my_iter = child_iter;
     }
 
-  gtk_list_store_set (GTK_LIST_STORE (model), &my_iter,
-                      GD_MAIN_COLUMN_SELECTED, value,
-                      -1);
+  if (GTK_IS_LIST_STORE (model))
+    {
+      gtk_list_store_set (GTK_LIST_STORE (model), &my_iter,
+                          GD_MAIN_COLUMN_SELECTED, value,
+                          -1);
+    }
+  else
+    {
+      gtk_tree_store_set (GTK_TREE_STORE (model), &my_iter,
+                          GD_MAIN_COLUMN_SELECTED, value,
+                          -1);
+    }
 }
 
 static void


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