[gnome-software/wip/kalev/download-step: 8/13] app row: Don't show size for offline updatable apps



commit dfa67d62cdcc87c89bd21085c08a8932ee141afd
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 6cc091c8..68717776 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -464,10 +464,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]