[gnome-software/gnome-3-20] Add an unreviewable application quirk



commit 91c811c03bfe593ab5c2b549924566b8bcc86ea5
Author: Richard Hughes <richard hughsie com>
Date:   Fri Apr 15 13:54:38 2016 +0100

    Add an unreviewable application quirk
    
    This allows vendors to provide GsApps in plugins that cannot be reviewed for
    technical or legal reasons.

 src/gs-app.h           |    4 ++++
 src/gs-shell-details.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.h b/src/gs-app.h
index 03b64b4..79becf7 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -77,6 +77,10 @@ typedef enum {
 #define AS_APP_QUIRK_MATCH_ANY_PREFIX          (1 << 3)
 #endif
 
+#if !AS_CHECK_VERSION(0,5,14)
+#define AS_APP_QUIRK_NOT_REVIEWABLE            (1 << 5)
+#endif
+
 GQuark          gs_app_error_quark             (void);
 
 GsApp          *gs_app_new                     (const gchar    *id);
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 50187e9..7e1982f 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1031,6 +1031,10 @@ gs_shell_details_refresh_reviews (GsShellDetails *self)
                break;
        }
 
+       /* some apps are unreviewable */
+       if (gs_app_has_quirk (self->app, AS_APP_QUIRK_NOT_REVIEWABLE))
+               show_reviews = FALSE;
+
        /* set the star rating */
        if (show_reviews) {
                if (gs_app_get_rating (self->app) >= 0) {


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