[gnome-software] trivial: Allow application reviews to be removed



commit d92240e871cefd665cb072259b2b775b73d776db
Author: Richard Hughes <richard hughsie com>
Date:   Wed Feb 10 08:44:37 2016 +0000

    trivial: Allow application reviews to be removed

 src/gs-app.c           |   10 ++++++++++
 src/gs-app.h           |    2 ++
 src/gs-plugin-loader.c |    3 +++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 24a1de4..a04a6c3 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1690,6 +1690,16 @@ gs_app_add_review (GsApp *app, GsReview *review)
 }
 
 /**
+ * gs_app_remove_review:
+ */
+void
+gs_app_remove_review (GsApp *app, GsReview *review)
+{
+       g_return_if_fail (GS_IS_APP (app));
+       g_ptr_array_remove (app->reviews, review);
+}
+
+/**
  * gs_app_get_size:
  */
 guint64
diff --git a/src/gs-app.h b/src/gs-app.h
index 4c90b0d..3b5ccb7 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -204,6 +204,8 @@ void                 gs_app_set_review_ratings      (GsApp          *app,
 GPtrArray      *gs_app_get_reviews             (GsApp          *app);
 void            gs_app_add_review              (GsApp          *app,
                                                 GsReview       *review);
+void            gs_app_remove_review           (GsApp          *app,
+                                                GsReview       *review);
 guint64                 gs_app_get_size                (GsApp          *app);
 void            gs_app_set_size                (GsApp          *app,
                                                 guint64         size);
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 77b7877..f5593d7 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2490,6 +2490,9 @@ gs_plugin_loader_review_action_thread_cb (GTask *task,
        if (g_strcmp0 (state->function_name, "gs_plugin_review_submit") == 0)
                gs_app_add_review (state->app, state->review);
 
+       /* remove this from the app */
+       gs_app_remove_review (state->app, state->review);
+
        g_task_return_boolean (task, TRUE);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]