[gnome-software] app row: Don't show size for offline updatable apps



commit ac8745558c6fb310690027e72b519e72e29df05e
Author: Kalev Lember <klember redhat com>
Date:   Tue Oct 23 12:24:52 2018 +0200

    app row: Don't show size for offline updatable apps
    
    ... as per the mockups.
    
    The size doesn't give any useful information as they cannot be updated
    separately. Instead, we should show the size for all the updates
    together in the updates section header.

 src/gs-app-row.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index cb168655..9d0fba98 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -468,10 +468,18 @@ gs_app_row_refresh (GsAppRow *app_row)
        }
 
        /* show the right size */
-       if (priv->show_installed_size)
+       if (priv->show_installed_size) {
                size = gs_app_get_size_installed (priv->app);
-       else if (priv->show_update)
-               size = gs_app_get_size_download (priv->app);
+       } else if (priv->show_update) {
+               switch (gs_app_get_state (priv->app)) {
+               case AS_APP_STATE_UPDATABLE_LIVE:
+               case AS_APP_STATE_INSTALLING:
+                       size = gs_app_get_size_download (priv->app);
+                       break;
+               default:
+                       break;
+               }
+       }
        if (size != GS_APP_SIZE_UNKNOWABLE && size != 0) {
                g_autofree gchar *sizestr = NULL;
                sizestr = g_format_size (size);


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