summaryrefslogtreecommitdiff
path: root/desktop/hotlist.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/hotlist.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/hotlist.c')
-rw-r--r--desktop/hotlist.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index fde4c33cf..bedb09535 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -1483,6 +1483,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)
{
treeview_edit_selection(hl_ctx.tree);