From 951ad51cd45ba2e5f49fab169ccbabc8f98a5185 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 13 Sep 2013 14:24:25 +0100 Subject: Add functions to get first selected hotlist/global_history node data. --- desktop/hotlist.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'desktop/hotlist.c') diff --git a/desktop/hotlist.c b/desktop/hotlist.c index fde4c33cf..bedb09535 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -1482,6 +1482,27 @@ bool hotlist_has_selection(void) } +/* Exported interface, documented in hotlist.h */ +bool hotlist_get_selection(nsurl **url, const char **title) +{ + struct hotlist_entry *e; + void *v; + + treeview_get_selection(hl_ctx.tree, &v); + if (v == NULL) { + *url = NULL; + *title = NULL; + return false; + } + + e = (struct hotlist_entry *)v; + + *url = e->url; + *title = e->data[HL_TITLE].value; + return true; +} + + /* Exported interface, documented in hotlist.h */ void hotlist_edit_selection(void) { -- cgit v1.2.3