summaryrefslogtreecommitdiff
path: root/desktop/hotlist.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-15 22:46:54 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-08-16 08:25:26 +0100
commit2c695bc2fa630594132a23f7ea7c3f4703e8e716 (patch)
tree2172aee66a4e285c20a8bcb53925619efd2bc986 /desktop/hotlist.c
parentff9155273edbd79213dc32599895f2b57f603319 (diff)
downloadnetsurf-2c695bc2fa630594132a23f7ea7c3f4703e8e716.tar.gz
netsurf-2c695bc2fa630594132a23f7ea7c3f4703e8e716.tar.bz2
Use abstracted folder creation.
Diffstat (limited to 'desktop/hotlist.c')
-rw-r--r--desktop/hotlist.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 35460e159..3c27ab177 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -522,7 +522,6 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
/* Directory handling, part 2: Make node, and handle children */
char *title;
hotlist_load_ctx new_ctx;
- struct treeview_field_data *field;
treeview_node *rel;
title = strndup(dom_string_data(current_ctx->title),
@@ -532,22 +531,10 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx)
return NSERROR_NOMEM;
}
- /* Create the folder node's title field */
- field = malloc(sizeof(struct treeview_field_data));
- if (field == NULL) {
- dom_string_unref(name);
- free(title);
- return NSERROR_NOMEM;
- }
- field->field = hl_ctx.fields[HL_FOLDER].field;
- field->value = title;
- field->value_len = strlen(title);
-
- /* Create the folder node */
- err = treeview_create_node_folder(current_ctx->tree,
- &rel, current_ctx->rel, current_ctx->relshp,
- field, field, hl_ctx.built ? TREE_CREATE_NONE :
- TREE_CREATE_SUPPRESS_RESIZE);
+ /* Add folder node */
+ err = hotlist_add_folder_internal(title, current_ctx->rel,
+ current_ctx->relshp, &rel);
+
current_ctx->rel = rel;
current_ctx->relshp = TREE_REL_NEXT_SIBLING;
@@ -665,6 +652,8 @@ static nserror hotlist_load(const char *path, bool *loaded)
return NSERROR_OK;
}
+ *loaded = true;
+
return NSERROR_OK;
}