From e82925cff0c9489353740c335e8ae91f760ce6d8 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 28 Jun 2016 08:14:49 +0100 Subject: trivial: Do not include the prefix in the id-filename --- libappstream-glib/as-app.c | 8 +++++--- libappstream-glib/as-self-test.c | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 85297a9..27a6f55 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -1651,11 +1651,13 @@ as_app_set_id (AsApp *app, const gchar *id) return; } + /* save full ID */ g_free (priv->id); - g_free (priv->id_filename); - priv->id = g_strdup (id); - priv->id_filename = g_strdup (priv->id); + + /* save filename */ + g_free (priv->id_filename); + priv->id_filename = g_strdup (as_app_get_id_no_prefix (app)); g_strdelimit (priv->id_filename, "&<>", '-'); tmp = g_strrstr_len (priv->id_filename, -1, "."); if (tmp != NULL) diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c index 5300e41..2c3c20e 100644 --- a/libappstream-glib/as-self-test.c +++ b/libappstream-glib/as-self-test.c @@ -2957,6 +2957,7 @@ as_test_store_flatpak_func (void) g_assert_cmpint (apps->len, ==, 1); app = g_ptr_array_index (apps, 0); g_assert_cmpstr (as_app_get_id (app), ==, "flatpak:test.desktop"); + g_assert_cmpstr (as_app_get_id_filename (app), ==, "test"); g_assert_cmpstr (as_app_get_origin (app), ==, "flatpak_remote-name"); g_assert_cmpstr (as_app_get_source_file (app), ==, filename); -- cgit v1.2.1