summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-06-28 08:14:49 +0100
committerRichard Hughes <richard@hughsie.com>2016-06-28 08:14:49 +0100
commite82925cff0c9489353740c335e8ae91f760ce6d8 (patch)
tree4f7f260ea06044f8987693bf183f9ae405844bc0
parent63d2d89eca6c185c251c02036328fec5a6692623 (diff)
downloadappstream-glib-e82925cff0c9489353740c335e8ae91f760ce6d8.tar.gz
trivial: Do not include the prefix in the id-filename
-rw-r--r--libappstream-glib/as-app.c8
-rw-r--r--libappstream-glib/as-self-test.c1
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);