[gnome-software] trivial: Add the new review to the application on success



commit fc0d9e2ebb6d97e24ba55232ec9ac07c48f20d26
Author: Richard Hughes <richard hughsie com>
Date:   Tue Feb 9 21:35:36 2016 +0000

    trivial: Add the new review to the application on success

 src/gs-plugin-loader.c |    4 ++++
 src/gs-shell-details.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index e5122f6..77b7877 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2486,6 +2486,10 @@ gs_plugin_loader_review_action_thread_cb (GTask *task,
                g_task_return_error (task, error);
        }
 
+       /* add this to the app */
+       if (g_strcmp0 (state->function_name, "gs_plugin_review_submit") == 0)
+               gs_app_add_review (state->app, state->review);
+
        g_task_return_boolean (task, TRUE);
 }
 
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 00370b1..e8c6c0d 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -971,6 +971,8 @@ gs_shell_details_refresh_addons (GsShellDetails *self)
        }
 }
 
+static void gs_shell_details_refresh_reviews (GsShellDetails *self);
+
 /**
  * gs_shell_details_app_set_review_cb:
  **/
@@ -986,7 +988,9 @@ gs_shell_details_app_set_review_cb (GObject *source,
        if (!gs_plugin_loader_app_action_finish (plugin_loader, res, &error)) {
                g_warning ("failed to set review %s: %s",
                           gs_app_get_id (self->app), error->message);
+               return;
        }
+       gs_shell_details_refresh_reviews (self);
 }
 
 static void


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