diff options
author | Jonathan Beck | 2009-09-06 23:47:57 +0200 |
---|---|---|
committer | Martin Szulecki | 2009-09-07 11:31:25 +0200 |
commit | 1265de6850023a989c987034609db5e264055ed2 (patch) | |
tree | c92d568ceb949dd5dbfba4c92f0105e65cdf4db8 /src/plist-utils.c | |
parent | a8ef94eb87ed1a7f5e155eed8c3139bc60040293 (diff) | |
download | gnome-plist-editor-1265de6850023a989c987034609db5e264055ed2.tar.gz gnome-plist-editor-1265de6850023a989c987034609db5e264055ed2.tar.bz2 |
Update treestore to only contain value nodes. Use 'Item n' for array items.
Diffstat (limited to 'src/plist-utils.c')
-rw-r--r-- | src/plist-utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plist-utils.c b/src/plist-utils.c index fe63439..cc3d11e 100644 --- a/src/plist-utils.c +++ b/src/plist-utils.c @@ -49,3 +49,23 @@ int plist_node_get_item_count(plist_t node) { return count; } +int plist_item_index(plist_t node) { + plist_t parent; + plist_t child; + int count = 0; + + parent = plist_get_parent(node); + + if (parent == NULL || node == NULL) { + return -1; + } + + child = plist_get_first_child(parent); + while (child && child != node) { + count ++; + child = plist_get_next_sibling(child); + } + + return count; +} + |