[gnome-software] details: Hide add/remove shortcut buttons for parentally filtered apps



commit 58dc261e55c56b389bc257d6c9c270fd945e2487
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Mar 12 18:12:48 2019 +0000

    details: Hide add/remove shortcut buttons for parentally filtered apps
    
    There’s no point in being able to add a shortcut to the desktop for an
    app if you are not allowed to launch it.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 src/gs-details-page.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index f2be29da..62c28bca 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -200,6 +200,11 @@ gs_details_page_update_shortcut_button (GsDetailsPage *self)
        if (gs_app_get_kind (self->app) != AS_APP_KIND_DESKTOP)
                return;
 
+       /* Leave the button hidden if the app can’t be launched by the current
+        * user. */
+       if (gs_app_has_quirk (self->app, GS_APP_QUIRK_PARENTAL_NOT_LAUNCHABLE))
+               return;
+
        /* only consider the shortcut button if the app is installed */
        switch (gs_app_get_state (self->app)) {
        case AS_APP_STATE_INSTALLED:


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