summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-01-25 19:20:54 +0000
committerRichard Hughes <richard@hughsie.com>2016-01-25 19:23:23 +0000
commit5a29c618423d0dd68eb1f1209749994b2a3d99fc (patch)
tree3797440f5df7f19f1013734eea8957935095bb17
parentcef24105dd7466fa9f872d6857ad3b3a560a43c1 (diff)
downloadappstream-glib-5a29c618423d0dd68eb1f1209749994b2a3d99fc.tar.gz
Fix a regression in the icon_path logic from the xdg-app merge
-rw-r--r--libappstream-glib/as-store.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index 82d4ffd..e80fa58 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -922,31 +922,18 @@ as_store_from_root (AsStore *store,
if (tmp != NULL)
as_store_set_builder_id (store, tmp);
- /* nothing specified */
- if (icon_root == NULL)
- icon_root = "/usr/share/app-info/";
-
- /* try the speecification directory first */
+ /* if we have an origin either from the XML or _set_origin() */
if (priv->origin != NULL) {
- icon_path = g_build_filename (icon_root,
- "..",
- "icons",
- priv->origin,
- NULL);
- if (!g_file_test (icon_path, G_FILE_TEST_IS_DIR)) {
- g_free (icon_path);
- icon_path = NULL;
- }
- }
-
- /* fall back to the xdg-app location */
- if (icon_path == NULL) {
- icon_path = g_build_filename (icon_root,
- "icons",
- NULL);
- if (!g_file_test (icon_path, G_FILE_TEST_IS_DIR)) {
- g_free (icon_path);
- icon_path = NULL;
+ if (icon_root == NULL)
+ icon_root = "/usr/share/app-info/icons/";
+ if (g_strcmp0 (priv->origin, "xdg-app") == 0) {
+ icon_path = g_build_filename (icon_root,
+ "icons",
+ NULL);
+ } else {
+ icon_path = g_build_filename (icon_root,
+ priv->origin,
+ NULL);
}
}