[gnome-software] Do not show 'Calculating' in the details panel if the app is not found



commit 0c45add13505f262f4b2aba84631cb8a3e251a90
Author: Richard Hughes <richard hughsie com>
Date:   Wed Oct 16 14:11:44 2013 +0100

    Do not show 'Calculating' in the details panel if the app is not found

 src/gs-app.h           |    2 ++
 src/gs-shell-details.c |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-app.h b/src/gs-app.h
index 5d46a21..f192c96 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -85,6 +85,8 @@ typedef enum {
 } GsAppIdKind;
 
 #define        GS_APP_INSTALL_DATE_UNKNOWN             1 /* 1s past the epoch */
+#define        GS_APP_SIZE_UNKNOWN                     0
+#define        GS_APP_SIZE_MISSING                     1
 
 GQuark          gs_app_error_quark             (void);
 GType           gs_app_get_type                (void);
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 3735c95..8e28b52 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -452,9 +452,12 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
 
        /* set the size */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_details_size_value"));
-       if (gs_app_get_size (priv->app) == 0) {
-               /* TRANSLATORS: this is where the licence is not known */
+       if (gs_app_get_size (priv->app) == GS_APP_SIZE_UNKNOWN) {
+               /* TRANSLATORS: this is where the size is being worked out */
                gtk_label_set_label (GTK_LABEL (widget), _("Calculating…"));
+       } else if (gs_app_get_size (priv->app) == GS_APP_SIZE_MISSING) {
+               /* TRANSLATORS: this is where the size is not known */
+               gtk_label_set_label (GTK_LABEL (widget), _("Unknown"));
        } else {
                size = g_format_size (gs_app_get_size (priv->app));
                gtk_label_set_label (GTK_LABEL (widget), size);


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