summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-01-15 15:03:43 +0000
committerRichard Hughes <richard@hughsie.com>2016-01-15 15:03:43 +0000
commit1b3311c5dee9a2a0ae334ebad25edbdd81832401 (patch)
treef006c345179ed872dc3427aad3ed5828d778f55b
parentcb9ff207838126788d2be1fc5ec2a6d0dc6aa1ea (diff)
downloadappstream-glib-1b3311c5dee9a2a0ae334ebad25edbdd81832401.tar.gz
Detect web-apps which are added as .desktop files
-rw-r--r--libappstream-glib/as-app-desktop.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-desktop.c b/libappstream-glib/as-app-desktop.c
index 7155a13..f84570e 100644
--- a/libappstream-glib/as-app-desktop.c
+++ b/libappstream-glib/as-app-desktop.c
@@ -425,6 +425,19 @@ as_app_parse_desktop_file (AsApp *app,
app_id = g_path_get_basename (desktop_file);
as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ /* is this really a web-app? */
+ if ((flags & AS_APP_PARSE_FLAG_USE_HEURISTICS) > 0) {
+ g_autofree gchar *exec = NULL;
+ exec = g_key_file_get_string (kf,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_EXEC,
+ NULL);
+ if (exec != NULL) {
+ if (g_str_has_prefix (exec, "epiphany"))
+ as_app_set_id_kind (app, AS_ID_KIND_WEB_APP);
+ }
+ }
+
/* is blacklisted */
if (as_utils_is_blacklisted_id (app_id))
as_app_add_veto (app, "%s is not an application", app_id);