[gnome-software] trivial: Always show an origin if it was requested in the GsAppRow



commit c9f5bfdfb4a54ab1fb43433a2e53267b52c951bd
Author: Richard Hughes <richard hughsie com>
Date:   Mon Aug 8 13:42:03 2016 +0100

    trivial: Always show an origin if it was requested in the GsAppRow
    
    Usually showing 'unknown' is a deeper bug, but it's somewhat less confusing to
    show something at least when the 'matching' app is likely going to have a
    source anyway.

 src/gs-app-row.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 8459bef..341b2da 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -332,13 +332,16 @@ gs_app_row_refresh (GsAppRow *app_row)
 
        /* where did this app come from */
        if (priv->show_source) {
+               g_autofree gchar *origin_tmp = NULL;
                tmp = gs_app_get_origin_hostname (priv->app);
-               if (tmp != NULL) {
-                       g_autofree gchar *origin_tmp = NULL;
+               if (tmp == NULL) {
                        /* TRANSLATORS: this refers to where the app came from */
-                       origin_tmp = g_strdup_printf ("%s: %s", _("Source"), tmp);
-                       gtk_label_set_label (GTK_LABEL (priv->label_origin), origin_tmp);
+                       tmp = _("unknown");
+                       g_error ("%s", gs_app_to_string (priv->app));
                }
+               /* TRANSLATORS: this refers to where the app came from */
+               origin_tmp = g_strdup_printf ("%s: %s", _("Source"), tmp);
+               gtk_label_set_label (GTK_LABEL (priv->label_origin), origin_tmp);
                gtk_widget_set_visible (priv->label_origin, tmp != NULL);
        } else {
                gtk_widget_set_visible (priv->label_origin, FALSE);


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