return settings_changed;
}
-void dumpTreeInfo(TreeInfo *node, int depth)
+int dumpTreeInfo(TreeInfo *node, int depth)
{
char bullet_list[] = { '-', '*', 'o' };
+ int num_leaf_nodes = 0;
int i;
if (depth == 0)
(node->node_parent ? node->node_parent->identifier : "-"),
(node->node_group ? "[GROUP]" : ""));
+ if (!node->node_group && !node->parent_link)
+ num_leaf_nodes++;
+
/*
// use for dumping artwork info tree
Debug("tree", "subdir == '%s' ['%s', '%s'] [%d])",
*/
if (node->node_group != NULL)
- dumpTreeInfo(node->node_group, depth + 1);
+ num_leaf_nodes += dumpTreeInfo(node->node_group, depth + 1);
node = node->next;
}
+
+ if (depth == 0)
+ Debug("tree", "Summary: %d leaf nodes found", num_leaf_nodes);
+
+ return num_leaf_nodes;
}
void sortTreeInfoBySortFunction(TreeInfo **node_first,
int getPosFromTreeInfo(TreeInfo *);
TreeInfo *getTreeInfoFromPos(TreeInfo *, int);
TreeInfo *getTreeInfoFromIdentifier(TreeInfo *, char *);
-void dumpTreeInfo(TreeInfo *, int);
+int dumpTreeInfo(TreeInfo *, int);
void sortTreeInfoBySortFunction(TreeInfo **,
int (*compare_function)(const void *,
const void *));