diff options
author | Richard Hughes <richard@hughsie.com> | 2015-07-23 22:12:31 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-07-25 19:26:13 +0100 |
commit | 1c003a633aca7ee639dfdcd8bfd6f0bca2887a42 (patch) | |
tree | 9751bdb968fd30c33b457c94b03983efd76b495f | |
parent | 5c1af6d62a35b8278c176de56f29204e9d63a21d (diff) | |
download | appstream-glib-1c003a633aca7ee639dfdcd8bfd6f0bca2887a42.tar.gz |
trivial: Set the source_file when using as_store_from_file()
-rw-r--r-- | libappstream-glib/as-self-test.c | 1 | ||||
-rw-r--r-- | libappstream-glib/as-store.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c index 3f1e118..9e7dc96 100644 --- a/libappstream-glib/as-self-test.c +++ b/libappstream-glib/as-self-test.c @@ -2675,6 +2675,7 @@ as_test_store_origin_func (void) g_assert_cmpstr (as_app_get_icon_path (app), ==, "/usr/share/app-info/icons/fedora-21"); g_assert_cmpstr (as_app_get_origin (app), ==, "fedora-21"); + g_assert_cmpstr (as_app_get_source_file (app), ==, filename); } static void diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index bf20f21..2083ceb 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -756,6 +756,7 @@ static gboolean as_store_from_root (AsStore *store, GNode *root, const gchar *icon_root, + const gchar *source_filename, GError **error) { AsStorePrivate *priv = GET_PRIVATE (store); @@ -834,6 +835,8 @@ as_store_from_root (AsStore *store, return FALSE; } as_app_set_origin (app, priv->origin); + if (source_filename != NULL) + as_app_set_source_file (app, source_filename); as_store_add_app (store, app); } @@ -959,7 +962,7 @@ as_store_from_file (AsStore *store, filename, error_local->message); return FALSE; } - return as_store_from_root (store, root, icon_root, error); + return as_store_from_root (store, root, icon_root, filename, error); } /** @@ -1003,7 +1006,7 @@ as_store_from_xml (AsStore *store, error_local->message); return TRUE; } - return as_store_from_root (store, root, icon_root, error); + return as_store_from_root (store, root, icon_root, NULL, error); } /** |