[gnome-software] odrs: Only define refine(), not refine_app()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] odrs: Only define refine(), not refine_app()
- Date: Wed, 22 Apr 2020 12:03:33 +0000 (UTC)
commit bfd33844c4c5f850c1f72452755d5ecbb39c76a7
Author: Philip Withnall <withnall endlessm com>
Date: Wed Apr 8 13:52:54 2020 +0100
odrs: Only define refine(), not refine_app()
See the previous commit for details.
Signed-off-by: Philip Withnall <withnall endlessm com>
plugins/odrs/gs-plugin-odrs.c | 34 ++++++++++++++++++++++++++++------
1 file changed, 28 insertions(+), 6 deletions(-)
---
diff --git a/plugins/odrs/gs-plugin-odrs.c b/plugins/odrs/gs-plugin-odrs.c
index b033e65b..17f2aab3 100644
--- a/plugins/odrs/gs-plugin-odrs.c
+++ b/plugins/odrs/gs-plugin-odrs.c
@@ -723,12 +723,12 @@ gs_plugin_odrs_refine_reviews (GsPlugin *plugin,
return TRUE;
}
-gboolean
-gs_plugin_refine_app (GsPlugin *plugin,
- GsApp *app,
- GsPluginRefineFlags flags,
- GCancellable *cancellable,
- GError **error)
+static gboolean
+refine_app (GsPlugin *plugin,
+ GsApp *app,
+ GsPluginRefineFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
/* not valid */
if (gs_app_get_kind (app) == AS_APP_KIND_ADDON)
@@ -758,6 +758,28 @@ gs_plugin_refine_app (GsPlugin *plugin,
return TRUE;
}
+gboolean
+gs_plugin_refine (GsPlugin *plugin,
+ GsAppList *list,
+ GsPluginRefineFlags flags,
+ GCancellable *cancellable,
+ GError **error)
+{
+ /* nothing to do here */
+ if ((flags & (GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING)) == 0)
+ return TRUE;
+
+ for (guint i = 0; i < gs_app_list_length (list); i++) {
+ GsApp *app = gs_app_list_index (list, i);
+ if (!refine_app (plugin, app, flags, cancellable, error))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static gchar *
gs_plugin_odrs_sanitize_version (const gchar *version)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]