[gnome-software] Show a placeholder when no update details are available



commit 7491627bfda14194d98e9bce93170d9e03a76539
Author: Kalev Lember <kalevlember gmail com>
Date:   Sat Jun 7 10:40:21 2014 +0200

    Show a placeholder when no update details are available
    
    Or rather, fix the existing one to properly show up and update its
    wording.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726501

 src/gs-update-dialog.c                    |    8 +++++---
 src/plugins/gs-plugin-packagekit-refine.c |    5 -----
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 01daa48..875f5c3 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -85,6 +85,7 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
        GsMarkdown *markdown;
        gchar *tmp;
        gchar *update_desc;
+       const gchar *update_details;
 
        /* set window title */
        kind = gs_app_get_kind (app);
@@ -99,15 +100,16 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
        }
 
        /* get the update description */
-       if (gs_app_get_update_details (app) == NULL) {
+       update_details = gs_app_get_update_details (app);
+       if (update_details == NULL || update_details[0] == '\0') {
                /* TRANSLATORS: this is where the packager did not write a
                 * description for the update */
-               update_desc = g_strdup ("No update description");
+               update_desc = g_strdup ("No update description available.");
        } else {
                markdown = gs_markdown_new (GS_MARKDOWN_OUTPUT_PANGO);
                gs_markdown_set_smart_quoting (markdown, FALSE);
                gs_markdown_set_autocode (markdown, TRUE);
-               update_desc = gs_markdown_parse (markdown, gs_app_get_update_details (app));
+               update_desc = gs_markdown_parse (markdown, update_details);
                g_object_unref (markdown);
        }
 
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index ee7e4dd..ff6a0f7 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -408,11 +408,6 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
                        gs_app_set_update_details (app, pk_update_detail_get_update_text (update_detail));
                        break;
                }
-               if (gs_app_get_update_details (app) == NULL) {
-                       /* TRANSLATORS: this is where update details either are
-                        * no longer available or were never provided in the first place */
-                       gs_app_set_update_details (app, _("No update details were provided"));
-               }
        }
 out:
        if (array != NULL)


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