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/global_history.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'desktop/global_history.c') diff --git a/desktop/global_history.c b/desktop/global_history.c index 191ff1966..94521e7c3 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -949,6 +949,27 @@ bool global_history_has_selection(void) } +/* Exported interface, documented in global_history.h */ +bool global_history_get_selection(nsurl **url, const char **title) +{ + struct global_history_entry *e; + void *v; + + treeview_get_selection(gh_ctx.tree, &v); + if (v == NULL) { + *url = NULL; + *title = NULL; + return false; + } + + e = (struct global_history_entry *)v; + + *url = e->url; + *title = e->data[GH_TITLE].value; + return true; +} + + /* Exported interface, documented in global_history.h */ nserror global_history_expand(bool only_folders) { -- cgit v1.2.3