[gnome-software] trivial: Don't show 'Application is ready to be used' for non-desktop apps



commit f9f7c1bcdd1ee15c0f6973326b2bd2f97b337073
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jul 19 12:43:38 2018 +0100

    trivial: Don't show 'Application is ready to be used' for non-desktop apps
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-software/issues/406

 src/gs-common.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-common.c b/src/gs-common.c
index ada4bab5..2e729c83 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -130,23 +130,32 @@ gs_app_notify_installed (GsApp *app)
        const gchar *body = NULL;
        g_autoptr(GNotification) n = NULL;
 
-       if (gs_app_get_kind (app) == AS_APP_KIND_OS_UPDATE) {
+       switch (gs_app_get_kind (app)) {
+       case AS_APP_KIND_OS_UPDATE:
                /* TRANSLATORS: this is the summary of a notification that OS updates
                 * have been successfully installed */
                summary = g_strdup (_("OS updates are now installed"));
                /* TRANSLATORS: this is the body of a notification that OS updates
                 * have been successfully installed */
                body = _("Recently installed updates are available to review");
-       } else {
+               break;
+       case AS_APP_KIND_DESKTOP:
                /* TRANSLATORS: this is the summary of a notification that an application
                 * has been successfully installed */
                summary = g_strdup_printf (_("%s is now installed"), gs_app_get_name (app));
                /* TRANSLATORS: this is the body of a notification that an application
                 * has been successfully installed */
                body = _("Application is ready to be used.");
+               break;
+       default:
+               /* TRANSLATORS: this is the summary of a notification that a component
+                * has been successfully installed */
+               summary = g_strdup_printf (_("%s is now installed"), gs_app_get_name (app));
+               break;
        }
        n = g_notification_new (summary);
-       g_notification_set_body (n, body);
+       if (body != NULL)
+               g_notification_set_body (n, body);
        if (gs_app_get_kind (app) == AS_APP_KIND_DESKTOP) {
                /* TRANSLATORS: this is button that opens the newly installed application */
                g_notification_add_button_with_target (n, _("Launch"),


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