summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-04-15 12:16:46 +0100
committerRichard Hughes <richard@hughsie.com>2017-04-15 12:16:46 +0100
commitb7fe571792213e379270170794308993093405ab (patch)
tree3ea6aea11c425e9b6dd8c451b4619dbc28d36b3c
parent8b156b9932ad2a08147005ccbfe20d53905b7552 (diff)
downloadappstream-glib-b7fe571792213e379270170794308993093405ab.tar.gz
Add functions for getting the AsStore search match
-rw-r--r--libappstream-glib/as-store.c20
-rw-r--r--libappstream-glib/as-store.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index f5b793a..afc717b 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -3442,7 +3442,7 @@ as_store_create_search_blacklist (AsStore *store)
/**
* as_store_set_search_match:
* @store: a #AsStore instance.
- * @search_match: the API version
+ * @search_match: the #AsAppSearchMatch, e.g. %AS_APP_SEARCH_MATCH_PKGNAME
*
* Sets the token match fields. The bitfield given here is used to choose what
* is included in the token cache.
@@ -3456,6 +3456,24 @@ as_store_set_search_match (AsStore *store, AsAppSearchMatch search_match)
priv->search_match = search_match;
}
+/**
+ * as_store_get_search_match:
+ * @store: a #AsStore instance.
+ *
+ * Gets the token match fields. The bitfield given here is used to choose what
+ * is included in the token cache.
+ *
+ * Returns: a #AsAppSearchMatch, e.g. %AS_APP_SEARCH_MATCH_PKGNAME
+ *
+ * Since: 0.6.13
+ **/
+AsAppSearchMatch
+as_store_get_search_match (AsStore *store)
+{
+ AsStorePrivate *priv = GET_PRIVATE (store);
+ return priv->search_match;
+}
+
static void
as_store_init (AsStore *store)
{
diff --git a/libappstream-glib/as-store.h b/libappstream-glib/as-store.h
index efbf567..898375f 100644
--- a/libappstream-glib/as-store.h
+++ b/libappstream-glib/as-store.h
@@ -187,6 +187,7 @@ gboolean as_store_load_path (AsStore *store,
void as_store_load_search_cache (AsStore *store);
void as_store_set_search_match (AsStore *store,
AsAppSearchMatch search_match);
+AsAppSearchMatch as_store_get_search_match (AsStore *store);
void as_store_remove_all (AsStore *store);
GPtrArray *as_store_get_apps (AsStore *store);
GPtrArray *as_store_get_apps_by_id (AsStore *store,