summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-08-04 19:59:03 +0100
committerRichard Hughes <richard@hughsie.com>2017-08-04 19:59:32 +0100
commit74ebf5192296f0ef26f6c51ee5f103d9fd72a3df (patch)
tree73924f385cfbad7c350a01cbb2041e18d76ffca3
parentf2ad871ad493fa84c4c2bc8c9a9a1de9793402ea (diff)
downloadappstream-glib-74ebf5192296f0ef26f6c51ee5f103d9fd72a3df.tar.gz
Allow remote icon types for desktop AppData files
If the icon is not redistributable we have to download the icon at runtime. Fixes: https://github.com/flathub/buildbot-config/issues/9
-rw-r--r--libappstream-glib/as-app-validate.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
index 7e86ff8..bc1cf65 100644
--- a/libappstream-glib/as-app-validate.c
+++ b/libappstream-glib/as-app-validate.c
@@ -1348,12 +1348,15 @@ as_app_validate (AsApp *app, AsAppValidateFlags flags, GError **error)
}
/* appdata */
- if (as_app_get_icon_default (app) != NULL &&
- as_format_get_kind (format) == AS_FORMAT_KIND_APPDATA &&
+ if (as_format_get_kind (format) == AS_FORMAT_KIND_APPDATA &&
as_app_get_kind (app) == AS_APP_KIND_DESKTOP) {
- ai_app_validate_add (helper,
- AS_PROBLEM_KIND_TAG_INVALID,
- "<icon> not allowed in desktop appdata");
+ AsIcon *icon = as_app_get_icon_default (app);
+ if (icon != NULL &&
+ as_icon_get_kind (icon) != AS_ICON_KIND_REMOTE) {
+ ai_app_validate_add (helper,
+ AS_PROBLEM_KIND_TAG_INVALID,
+ "<icon> not allowed in desktop appdata");
+ }
}
/* extends */