summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-06-16 15:53:55 +0100
committerRichard Hughes <richard@hughsie.com>2015-06-16 15:53:55 +0100
commit6538d331a842da7132c327e2dd9143012cff05c6 (patch)
treebe9954848227edf3e82718c1f5aca623f1684405
parent7887549cc09fd886210fa0fcdefc12cfd22b4736 (diff)
downloadappstream-glib-6538d331a842da7132c327e2dd9143012cff05c6.tar.gz
Add a flag to relax the AppData Category=Settings requirement
-rw-r--r--client/as-builder.c4
-rw-r--r--libappstream-builder/asb-context.h2
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c10
3 files changed, 12 insertions, 4 deletions
diff --git a/client/as-builder.c b/client/as-builder.c
index 946ac25..96372f3 100644
--- a/client/as-builder.c
+++ b/client/as-builder.c
@@ -305,6 +305,10 @@ main (int argc, char **argv)
flags |= ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS;
continue;
}
+ if (g_strcmp0 (veto_ignore[i], "ignore-settings") == 0) {
+ flags |= ASB_CONTEXT_FLAG_IGNORE_SETTINGS;
+ continue;
+ }
g_warning ("Unknown flag name: %s, "
"expected 'missing-info' or 'missing-parents'",
veto_ignore[i]);
diff --git a/libappstream-builder/asb-context.h b/libappstream-builder/asb-context.h
index 4a5f52c..29a75e1 100644
--- a/libappstream-builder/asb-context.h
+++ b/libappstream-builder/asb-context.h
@@ -72,6 +72,7 @@ struct _AsbContextClass
* @ASB_CONTEXT_FLAG_IGNORE_DEAD_UPSTREAM: Include apps that are dead upstream
* @ASB_CONTEXT_FLAG_IGNORE_OBSOLETE_DEPS: Include apps that use obsolete toolkits
* @ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS: Include apps that use legacy icon formats
+ * @ASB_CONTEXT_FLAG_IGNORE_SETTINGS: Include apps that are marked as settings
*
* The flags to use when processing the context.
**/
@@ -88,6 +89,7 @@ typedef enum {
ASB_CONTEXT_FLAG_IGNORE_DEAD_UPSTREAM = 1 << 7, /* Since: 0.4.1 */
ASB_CONTEXT_FLAG_IGNORE_OBSOLETE_DEPS = 1 << 8, /* Since: 0.4.1 */
ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS = 1 << 9, /* Since: 0.4.1 */
+ ASB_CONTEXT_FLAG_IGNORE_SETTINGS = 1 << 10, /* Since: 0.4.1 */
/*< private >*/
ASB_CONTEXT_FLAG_LAST,
} AsbContextFlags;
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index df5d5eb..22ecd42 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -335,10 +335,12 @@ asb_plugin_process_filename (AsbPlugin *plugin,
asb_app_add_requires_appdata (app, "NoDisplay=true");
/* Settings or DesktopSettings requires AppData */
- if (as_app_has_category (AS_APP (app), "Settings"))
- asb_app_add_requires_appdata (app, "Category=Settings");
- if (as_app_has_category (AS_APP (app), "DesktopSettings"))
- asb_app_add_requires_appdata (app, "Category=DesktopSettings");
+ if (!asb_context_get_flag (plugin->ctx, ASB_CONTEXT_FLAG_IGNORE_SETTINGS)) {
+ if (as_app_has_category (AS_APP (app), "Settings"))
+ asb_app_add_requires_appdata (app, "Category=Settings");
+ if (as_app_has_category (AS_APP (app), "DesktopSettings"))
+ asb_app_add_requires_appdata (app, "Category=DesktopSettings");
+ }
/* is the icon a stock-icon-name? */
icon = as_app_get_icon_default (AS_APP (app));