[gnome-software] app row: Fix description to show up for UNAVAILABLE apps



commit 5080f7f2fa79442ebdd340b3139d44d304a13ed8
Author: Kalev Lember <klember redhat com>
Date:   Thu Jun 2 15:34:49 2016 +0200

    app row: Fix description to show up for UNAVAILABLE apps
    
    Be more careful to not fall into missing description special case when
    handling apps that come from enabled_metadata=1 repos and are in the
    UNAVAILABLE state.

 src/gs-app-row.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 5f634c5..bbac753 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -93,8 +93,13 @@ gs_app_row_get_description (GsAppRow *app_row)
                        return g_string_new (tmp);
        }
 
-       if (gs_app_get_state (priv->app) == AS_APP_STATE_UNAVAILABLE)
-               return g_string_new (gs_app_get_summary_missing (priv->app));
+       /* if missing summary is set, return it without escaping in order to
+        * correctly show hyperlinks */
+       if (gs_app_get_state (priv->app) == AS_APP_STATE_UNAVAILABLE) {
+               tmp = gs_app_get_summary_missing (priv->app);
+               if (tmp != NULL && tmp[0] != '\0')
+                       return g_string_new (tmp);
+       }
 
        /* try all these things in order */
        if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))


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