[gnome-software] category page: Hide sort button for shell extensions as well



commit 949d268043281fffc6a2b285736f8604d2193baa
Author: Kalev Lember <klember redhat com>
Date:   Thu Feb 22 14:38:53 2018 +0100

    category page: Hide sort button for shell extensions as well
    
    ODRS currently only supports rating desktop apps. When rating shell
    extensions I get this:
    
    13:33:14:0588 GsPluginOdrs Failed to set rating on odrs: Bad Request
    13:33:14:0588 Gs  failed to set review on screenshot-window-sizer gnome-shell-extensions gcampax github 
com.shell-extension: only applications can be reviewed at this time
    
    This commit makes sure that we hide the sort button for shell extensions
    as well, as it doesn't currently do anything without any ratings data.
    
    https://gitlab.gnome.org/GNOME/gnome-software/issues/303

 src/gs-category-page.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index c976f4ea..5892b988 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -337,24 +337,22 @@ gs_category_page_reload (GsPage *page)
                 gs_category_get_id (self->category),
                 gs_category_get_id (self->subcategory));
 
+       /* don't show the sort button on addons that cannot be rated */
        if (g_strcmp0 (gs_category_get_id (self->category), "addons") == 0) {
-               if (g_strcmp0 (gs_category_get_id (self->subcategory), "shell-extensions") != 0) {
-                       /* we don't want to show the sort button on the addons that
-                        * cannot be rated */
-                       gtk_widget_set_visible (self->subcats_sort_label, FALSE);
-                       gtk_widget_set_visible (self->subcats_sort_button, FALSE);
-               } else {
-                       /* show the shell extensions header and the sort button */
-                       gtk_widget_set_visible (self->infobar_category_shell_extensions, TRUE);
-                       gtk_widget_set_visible (self->subcats_sort_label, TRUE);
-                       gtk_widget_set_visible (self->subcats_sort_button, TRUE);
-               }
+               gtk_widget_set_visible (self->subcats_sort_label, FALSE);
+               gtk_widget_set_visible (self->subcats_sort_button, FALSE);
+
        } else {
-               gtk_widget_set_visible (self->infobar_category_shell_extensions, FALSE);
                gtk_widget_set_visible (self->subcats_sort_label, TRUE);
                gtk_widget_set_visible (self->subcats_sort_button, TRUE);
        }
 
+       /* show the shell extensions header */
+       if (g_strcmp0 (gs_category_get_id (self->subcategory), "shell-extensions") == 0)
+               gtk_widget_set_visible (self->infobar_category_shell_extensions, TRUE);
+       else
+               gtk_widget_set_visible (self->infobar_category_shell_extensions, FALSE);
+
        if (self->sort_rating_handler_id > 0) {
                g_signal_handler_disconnect (self->sort_rating_button,
                                             self->sort_rating_handler_id);


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