[gnome-software] details page: Use QUIRK_HAS_SOURCE for detecting repo-release packages



commit d42fb650388b6a052a39ed99a7e4d6d63d904444
Author: Kalev Lember <klember redhat com>
Date:   Thu Feb 15 13:21:35 2018 +0100

    details page: Use QUIRK_HAS_SOURCE for detecting repo-release packages

 src/gs-details-page.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 800bc596..ab9b9ac8 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1059,26 +1059,26 @@ gs_details_page_refresh_all (GsDetailsPage *self)
                                gs_app_has_quirk (self->app, AS_APP_QUIRK_COMPULSORY) &&
                                gs_app_get_state (self->app) == AS_APP_STATE_AVAILABLE_LOCAL);
 
-       /* is this a repo-release */
-       switch (gs_app_get_kind (self->app)) {
-       case AS_APP_KIND_SOURCE:
-               gtk_widget_set_visible (self->infobar_details_repo, gs_app_get_state (self->app) == 
AS_APP_STATE_AVAILABLE_LOCAL);
-               break;
-       default:
-               gtk_widget_set_visible (self->infobar_details_repo, FALSE);
-               break;
-       }
-
-       /* installing a app with a repo file */
        switch (gs_app_get_kind (self->app)) {
        case AS_APP_KIND_DESKTOP:
+               /* installing an app with a repo file */
                gtk_widget_set_visible (self->infobar_details_app_repo,
                                        gs_app_has_quirk (self->app,
                                                          AS_APP_QUIRK_HAS_SOURCE) &&
                                        gs_app_get_state (self->app) == AS_APP_STATE_AVAILABLE_LOCAL);
+               gtk_widget_set_visible (self->infobar_details_repo, FALSE);
+               break;
+       case AS_APP_KIND_GENERIC:
+               /* installing a repo-release package */
+               gtk_widget_set_visible (self->infobar_details_app_repo, FALSE);
+               gtk_widget_set_visible (self->infobar_details_repo,
+                                       gs_app_has_quirk (self->app,
+                                                         AS_APP_QUIRK_HAS_SOURCE) &&
+                                       gs_app_get_state (self->app) == AS_APP_STATE_AVAILABLE_LOCAL);
                break;
        default:
                gtk_widget_set_visible (self->infobar_details_app_repo, FALSE);
+               gtk_widget_set_visible (self->infobar_details_repo, FALSE);
                break;
        }
 


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