summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-03-08 17:05:16 +0000
committerRichard Hughes <richard@hughsie.com>2017-03-08 17:06:19 +0000
commit62943ed493f683ffd1ecb6916ac97ae38a3b0916 (patch)
tree25a831c9792ecf0322ec800d34040d5c1c848c00 /client
parentcba934db8c8ee2b093f5120e63ad9cf620c16524 (diff)
downloadappstream-glib-62943ed493f683ffd1ecb6916ac97ae38a3b0916.tar.gz
Fix a problem with appstream-compose with older AppData files
Do not remove the desktop-provided 'Name' and 'Comment' if there is no AppData-provided version.
Diffstat (limited to 'client')
-rw-r--r--client/as-compose.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/client/as-compose.c b/client/as-compose.c
index 4f45f39..6d63c55 100644
--- a/client/as-compose.c
+++ b/client/as-compose.c
@@ -231,10 +231,6 @@ load_desktop (const gchar *prefix,
}
}
- /* never inherit from the desktop file (they may be prefixed) */
- g_hash_table_remove_all (as_app_get_names (app));
- g_hash_table_remove_all (as_app_get_comments (app));
-
return g_steal_pointer (&app);
}
@@ -480,6 +476,14 @@ main (int argc, char **argv)
error->message);
return EXIT_FAILURE;
}
+
+ /* if the appdata <name> exists, do not inherit from
+ * the desktop file as it may be prefixed */
+ if (g_hash_table_size (as_app_get_names (app_appdata)) > 0)
+ g_hash_table_remove_all (as_app_get_names (app_desktop));
+ if (g_hash_table_size (as_app_get_comments (app_appdata)) > 0)
+ g_hash_table_remove_all (as_app_get_comments (app_desktop));
+
as_store_add_app (store, app_desktop);
}
}