[gnome-software] trivial: Add one more REQUIRE flag for content rating
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Add one more REQUIRE flag for content rating
- Date: Tue, 9 Oct 2018 06:22:46 +0000 (UTC)
commit 03d885e6d5de549dbc7e911d21ec63ba82df9eb8
Author: Richard Hughes <richard hughsie com>
Date: Tue Oct 9 07:21:20 2018 +0100
trivial: Add one more REQUIRE flag for content rating
This isn't always going to be free...
lib/gs-cmd.c | 2 ++
lib/gs-plugin-types.h | 2 ++
lib/gs-plugin.c | 2 ++
src/gs-details-page.c | 3 +++
4 files changed, 9 insertions(+)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index e16487e1..9ad5430d 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -148,6 +148,8 @@ gs_cmd_refine_flag_from_string (const gchar *flag, GError **error)
return GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME;
if (g_strcmp0 (flag, "kudos") == 0)
return GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS;
+ if (g_strcmp0 (flag, "content-rating") == 0)
+ return GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING;
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index ffa5d8f4..4192c01a 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -157,6 +157,7 @@ typedef enum {
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP: Require project group
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME: Require developer name
* @GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS: Require kudos
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING: Require content rating
*
* The refine flags.
**/
@@ -192,6 +193,7 @@ typedef enum {
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP ((guint64) 1 << 28)
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME ((guint64) 1 << 29)
#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS ((guint64) 1 << 30)
+#define GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING ((guint64) 1 << 31)
typedef guint64 GsPluginRefineFlags;
/**
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index a0a8eb60..2b5e130a 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -2050,6 +2050,8 @@ gs_plugin_refine_flags_to_string (GsPluginRefineFlags refine_flags)
g_ptr_array_add (cstrs, "require-developer-name");
if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS)
g_ptr_array_add (cstrs, "require-kudos");
+ if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING)
+ g_ptr_array_add (cstrs, "content-rating");
if (cstrs->len == 0)
return g_strdup ("none");
g_ptr_array_add (cstrs, NULL);
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index bbe6943b..c3d6597f 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1816,6 +1816,7 @@ gs_details_page_set_local_file (GsDetailsPage *self, GFile *file)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
NULL);
gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
@@ -1848,6 +1849,7 @@ gs_details_page_set_url (GsDetailsPage *self, const gchar *url)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
NULL);
gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
@@ -1878,6 +1880,7 @@ gs_details_page_load (GsDetailsPage *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
NULL);
gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]