[gnome-software] trivial: Show the warning if the large icon failed to be loaded



commit ed96b311e868ba2cad9285762ce68689ebc1bc9b
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 28 12:55:52 2013 +0000

    trivial: Show the warning if the large icon failed to be loaded
    
    This is probably another problem in the stack, but it's helpful to show
    something on the console.

 src/gs-shell-details.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index e57ed76..29b4c6e 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -436,6 +436,7 @@ out:
 static void
 gs_shell_details_refresh_all (GsShellDetails *shell_details)
 {
+       GError *error = NULL;
        GPtrArray *history;
        GdkPixbuf *pixbuf = NULL;
        GsShellDetailsPrivate *priv = shell_details->priv;
@@ -474,8 +475,14 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
 
        /* set the icon */
        tmp = gs_app_get_metadata_item (priv->app, "DataDir::desktop-icon");
-       if (tmp != NULL)
-               pixbuf = gs_pixbuf_load (tmp, 96, NULL);
+       if (tmp != NULL) {
+               pixbuf = gs_pixbuf_load (tmp, 96, &error);
+               if (pixbuf == NULL) {
+                       g_warning ("Failed to load desktop icon: %s",
+                                  error->message);
+                       g_clear_error (&error);
+               }
+       }
        if (pixbuf == NULL)
                pixbuf = gs_app_get_pixbuf (priv->app);
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "application_details_icon"));


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