Skip to content

Commit 4fd4ca5

Browse files
committed
validator: Check screenshot environment property
1 parent 0eb99b9 commit 4fd4ca5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/as-validator-issue-tag.h

+6
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ AsValidatorIssueTag as_validator_issue_tag_list[] = {
205205
N_("The update-contact does not appear to be a valid email address (escaping of `@` is only allowed as `_at_` or `_AT_`).")
206206
},
207207

208+
{ "screenshot-invalid-env-style",
209+
AS_ISSUE_SEVERITY_WARNING,
210+
/* TRANSLATORS: Please do not translate AppStream tag/property names (in backticks). */
211+
N_("The `environment` property is set to an unrecognized graphical environment/style combination.")
212+
},
213+
208214
{ "screenshot-invalid-width",
209215
AS_ISSUE_SEVERITY_WARNING,
210216
/* TRANSLATORS: Please do not translate AppStream tag/property names (in backticks). */

src/as-validator.c

+9
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,7 @@ as_validator_check_screenshots (AsValidator *validator, xmlNode *node, AsCompone
14481448
gboolean caption_found = FALSE;
14491449
gboolean is_default_screenshot = FALSE;
14501450
g_autofree gchar *scr_kind_str = NULL;
1451+
g_autofree gchar *scr_env_style = NULL;
14511452
gboolean have_source_image = FALSE;
14521453
g_autoptr(GHashTable) known_source_locale = NULL;
14531454

@@ -1462,6 +1463,14 @@ as_validator_check_screenshots (AsValidator *validator, xmlNode *node, AsCompone
14621463
is_default_screenshot = TRUE;
14631464
}
14641465

1466+
scr_env_style = as_xml_get_prop_value (iter, "environment");
1467+
if (scr_env_style != NULL && !as_utils_is_gui_environment_style (scr_env_style)) {
1468+
as_validator_add_issue (validator,
1469+
iter,
1470+
"screenshot-invalid-env-style",
1471+
scr_env_style);
1472+
}
1473+
14651474
if (g_strcmp0 ((const gchar *) iter->name, "screenshot") != 0) {
14661475
as_validator_add_issue (
14671476
validator,

0 commit comments

Comments
 (0)