From 214f436b072e035aa6a53f3c4d62028cd56753fc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 24 Feb 2020 08:49:50 +0000 Subject: Cookie manager: Add API to set the search string. --- desktop/cookie_manager.c | 13 +++++++++++++ desktop/cookie_manager.h | 9 +++++++++ 2 files changed, 22 insertions(+) (limited to 'desktop') diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c index a2aab8e9f..3e0417f23 100644 --- a/desktop/cookie_manager.c +++ b/desktop/cookie_manager.c @@ -545,6 +545,19 @@ void cookie_manager_remove(const struct cookie_data *data) } +/* exported interface documented in cookie_manager.h */ +nserror cookie_manager_set_search_string( + const char *string) +{ + /* If we don't have a cookie manager at the moment, just return */ + if (cm_ctx.tree == NULL) { + return NSERROR_NOT_FOUND; + } + + return treeview_set_search_string(cm_ctx.tree, string); +} + + /** * Initialise the treeview entry feilds * diff --git a/desktop/cookie_manager.h b/desktop/cookie_manager.h index 4ae74a25f..11d03252e 100644 --- a/desktop/cookie_manager.h +++ b/desktop/cookie_manager.h @@ -75,6 +75,15 @@ bool cookie_manager_add(const struct cookie_data *data); */ void cookie_manager_remove(const struct cookie_data *data); +/** + * Set the cookie manager search string. + * + * \param string Sering to set as search string. + * \return NSERROR_OK on success, appropriate error otherwise + */ +nserror cookie_manager_set_search_string( + const char *string); + /** * Redraw the cookies manager. * -- cgit v1.2.3