[gnome-software] Remove support for the unused rating_confidence value
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Remove support for the unused rating_confidence value
- Date: Thu, 28 Jan 2016 15:03:10 +0000 (UTC)
commit 16a9afd6dda192232789a14dec1603e69aa2a7b9
Author: Richard Hughes <richard hughsie com>
Date: Thu Jan 28 12:00:59 2016 +0000
Remove support for the unused rating_confidence value
src/gs-app.c | 37 +------------------------
src/gs-app.h | 3 --
src/plugins/gs-plugin-fedora-tagger-ratings.c | 1 -
src/plugins/gs-plugin-local-ratings.c | 1 -
4 files changed, 1 insertions(+), 41 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 992d01e..49f6d89 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2013-2014 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
* Copyright (C) 2013 Matthias Clasen <mclasen redhat com>
*
* Licensed under the GNU General Public License Version 2
@@ -83,7 +83,6 @@ struct _GsApp
AsUrgencyKind update_urgency;
gchar *management_plugin;
gint rating;
- gint rating_confidence;
guint64 size;
GsAppKind kind;
AsIdKind id_kind;
@@ -291,8 +290,6 @@ gs_app_to_string (GsApp *app)
g_string_append_printf (str, "\torigin-ui:\t%s\n", app->origin_ui);
if (app->rating != -1)
g_string_append_printf (str, "\trating:\t%i\n", app->rating);
- if (app->rating_confidence != -1)
- g_string_append_printf (str, "\trating-confidence:\t%i\n", app->rating_confidence);
if (app->pixbuf != NULL)
g_string_append_printf (str, "\tpixbuf:\t%p\n", app->pixbuf);
if (app->featured_pixbuf != NULL)
@@ -1664,37 +1661,6 @@ gs_app_set_rating (GsApp *app, gint rating)
}
/**
- * gs_app_get_rating_confidence:
- * @app: A #GsApp instance
- *
- * Return value: a predictor from 0 to 100, or -1 for unknown or invalid
- */
-gint
-gs_app_get_rating_confidence (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), -1);
- return app->rating_confidence;
-}
-
-/**
- * gs_app_set_rating_confidence:
- * @app: A #GsApp instance
- * @rating_confidence: a predictor from 0 to 100, or -1 for unknown or invalid
- *
- * This is how confident the rating is statistically valid, expressed as a
- * percentage.
- * Applications with a high confidence typically have a large number of samples
- * and can be trusted, but low confidence could mean that only one person has
- * rated the application.
- */
-void
-gs_app_set_rating_confidence (GsApp *app, gint rating_confidence)
-{
- g_return_if_fail (GS_IS_APP (app));
- app->rating_confidence = rating_confidence;
-}
-
-/**
* gs_app_get_size:
*/
guint64
@@ -2417,7 +2383,6 @@ static void
gs_app_init (GsApp *app)
{
app->rating = -1;
- app->rating_confidence = -1;
app->sources = g_ptr_array_new_with_free_func (g_free);
app->source_ids = g_ptr_array_new_with_free_func (g_free);
app->categories = g_ptr_array_new_with_free_func (g_free);
diff --git a/src/gs-app.h b/src/gs-app.h
index ba3b078..2da2515 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -199,9 +199,6 @@ void gs_app_set_metadata (GsApp *app,
gint gs_app_get_rating (GsApp *app);
void gs_app_set_rating (GsApp *app,
gint rating);
-gint gs_app_get_rating_confidence (GsApp *app);
-void gs_app_set_rating_confidence (GsApp *app,
- gint rating_confidence);
guint64 gs_app_get_size (GsApp *app);
void gs_app_set_size (GsApp *app,
guint64 size);
diff --git a/src/plugins/gs-plugin-fedora-tagger-ratings.c b/src/plugins/gs-plugin-fedora-tagger-ratings.c
index b0f4a46..5535f72 100644
--- a/src/plugins/gs-plugin-fedora-tagger-ratings.c
+++ b/src/plugins/gs-plugin-fedora-tagger-ratings.c
@@ -623,7 +623,6 @@ gs_plugin_refine (GsPlugin *plugin,
g_debug ("fedora-tagger setting rating on %s to %i%% [%i]",
pkgname, rating, confidence);
gs_app_set_rating (app, rating);
- gs_app_set_rating_confidence (app, confidence);
if (confidence > 50 && rating > 80) {
g_debug ("%s is popular [confidence %i]",
gs_app_get_source_default (app),
diff --git a/src/plugins/gs-plugin-local-ratings.c b/src/plugins/gs-plugin-local-ratings.c
index b44d3bf..67cc1fb 100644
--- a/src/plugins/gs-plugin-local-ratings.c
+++ b/src/plugins/gs-plugin-local-ratings.c
@@ -245,7 +245,6 @@ gs_plugin_refine (GsPlugin *plugin,
rating = gs_plugin_local_find_app (plugin, gs_app_get_id (app));
if (rating != -1) {
gs_app_set_rating (app, rating);
- gs_app_set_rating_confidence (app, 100);
if (rating > 80)
gs_app_add_kudo (app, GS_APP_KUDO_POPULAR);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]