summaryrefslogtreecommitdiff
path: root/desktop/global_history.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-09-13 14:24:25 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-09-13 14:24:25 +0100
commit951ad51cd45ba2e5f49fab169ccbabc8f98a5185 (patch)
tree02b09d86bc9477e42e8c6c81bb77a02d844ba9ad /desktop/global_history.c
parent653cf8fa1fe9796b48988ac8fd726056a55c70f4 (diff)
downloadnetsurf-951ad51cd45ba2e5f49fab169ccbabc8f98a5185.tar.gz
netsurf-951ad51cd45ba2e5f49fab169ccbabc8f98a5185.tar.bz2
Add functions to get first selected hotlist/global_history node data.
Diffstat (limited to 'desktop/global_history.c')
-rw-r--r--desktop/global_history.c21
1 files changed, 21 insertions, 0 deletions
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
@@ -950,6 +950,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)
{
return treeview_expand(gh_ctx.tree, only_folders);