[anjuta/gnome-3-0] symbol-db: Consider NULL as valid input for sdb_model_iter_n_children
- From: Naba Kumar <naba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/gnome-3-0] symbol-db: Consider NULL as valid input for sdb_model_iter_n_children
- Date: Thu, 19 May 2011 21:44:39 +0000 (UTC)
commit a68b9f1b78148fe3c73cc0e7fc418a39a9231580
Author: Naba Kumar <naba gnome org>
Date: Thu May 19 17:23:34 2011 +0300
symbol-db: Consider NULL as valid input for sdb_model_iter_n_children
plugins/symbol-db/symbol-db-model.c | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-model.c b/plugins/symbol-db/symbol-db-model.c
index 64cf5bd..3678b28 100644
--- a/plugins/symbol-db/symbol-db-model.c
+++ b/plugins/symbol-db/symbol-db-model.c
@@ -833,15 +833,26 @@ sdb_model_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
gint offset;
+ SymbolDBModelPriv *priv;
SymbolDBModelNode *node, *parent_node;
- g_return_val_if_fail (sdb_model_iter_is_valid (tree_model, iter),
- FALSE);
-
- parent_node = (SymbolDBModelNode*) iter->user_data;
- offset = GPOINTER_TO_INT (iter->user_data2);
-
- node = sdb_model_node_get_child (parent_node, offset);
+ g_return_val_if_fail (SYMBOL_DB_IS_MODEL (tree_model), 0);
+ priv = SYMBOL_DB_MODEL (tree_model)->priv;
+
+ if (iter)
+ {
+ g_return_val_if_fail (sdb_model_iter_is_valid (tree_model, iter), 0);
+ }
+
+ if (iter == NULL)
+ node = priv->root;
+ else
+ {
+ parent_node = (SymbolDBModelNode*) iter->user_data;
+ offset = GPOINTER_TO_INT (iter->user_data2);
+ node = sdb_model_node_get_child (parent_node, offset);
+ }
+
if (node == NULL)
return 0;
if (!node->children_ensured)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]