Make releationship enum meanings clearer.

This commit is contained in:
Michael Drake 2013-06-04 12:24:14 +01:00
parent cdf9c9ba72
commit abf5512aff
3 changed files with 9 additions and 9 deletions

View File

@ -175,7 +175,7 @@ static nserror global_history_entry_insert(struct global_history_entry *e,
}
err = treeview_create_node_entry(gh_ctx.tree, &(e->entry),
parent, TREE_REL_CHILD, e->data, e);
parent, TREE_REL_FIRST_CHILD, e->data, e);
if (err != NSERROR_OK) {
return err;
}
@ -429,7 +429,7 @@ static nserror global_history_init_dir(enum global_history_folders f,
nserror err;
time_t t = gh_ctx.today;
struct treeview_node *relation = NULL;
enum treeview_relationship rel = TREE_REL_CHILD;
enum treeview_relationship rel = TREE_REL_FIRST_CHILD;
t -= age * N_SEC_PER_DAY;
@ -437,7 +437,7 @@ static nserror global_history_init_dir(enum global_history_folders f,
if (f != GH_TODAY) {
relation = gh_ctx.folders[f - 1].folder;
rel = TREE_REL_SIBLING_NEXT;
rel = TREE_REL_NEXT_SIBLING;
}
gh_ctx.folders[f].data.field = gh_ctx.fields[N_FIELDS - 1].field;

View File

@ -199,7 +199,7 @@ static inline void treeview_insert_node(struct treeview_node *a,
assert(b != NULL);
switch (rel) {
case TREE_REL_CHILD:
case TREE_REL_FIRST_CHILD:
assert(b->type != TREE_NODE_ENTRY);
a->parent = b;
a->sibling_next = b->children;
@ -208,7 +208,7 @@ static inline void treeview_insert_node(struct treeview_node *a,
b->children = a;
break;
case TREE_REL_SIBLING_NEXT:
case TREE_REL_NEXT_SIBLING:
assert(b->type != TREE_NODE_ROOT);
a->sibling_prev = b;
a->sibling_next = b->sibling_next;
@ -261,7 +261,7 @@ nserror treeview_create_node_folder(struct treeview *tree,
if (relation == NULL) {
relation = tree->root;
rel = TREE_REL_CHILD;
rel = TREE_REL_FIRST_CHILD;
}
n = malloc(sizeof(struct treeview_node));
@ -372,7 +372,7 @@ nserror treeview_create_node_entry(struct treeview *tree,
if (relation == NULL) {
relation = tree->root;
rel = TREE_REL_CHILD;
rel = TREE_REL_FIRST_CHILD;
}
e = malloc(sizeof(struct treeview_node_entry) +

View File

@ -33,8 +33,8 @@ struct treeview;
struct treeview_node;
enum treeview_relationship {
TREE_REL_CHILD,
TREE_REL_SIBLING_NEXT
TREE_REL_FIRST_CHILD,
TREE_REL_NEXT_SIBLING
};
enum treeview_msg {