[gnome-initial-setup] More debug info for loading avatars



commit 68bfed0bbe1cb898df6e59f216046d88f61bcc05
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Mar 2 02:32:51 2014 -0500

    More debug info for loading avatars

 .../pages/account/gis-account-page-local.c         |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/gis-account-page-local.c 
b/gnome-initial-setup/pages/account/gis-account-page-local.c
index 4a87173..29f03af 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.c
@@ -201,11 +201,20 @@ prepopulate_account_page (GisAccountPageLocal *page)
 
   if (picture) {
     GFile *file;
-    GInputStream *stream;
+    GFileInputStream *stream;
+    GError *error = NULL;
     file = g_file_new_for_uri (picture);
-    stream = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
-    pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream, -1, 96, TRUE, NULL, NULL);
-    g_object_unref (stream);
+    stream = g_file_read (file, NULL, &error);
+    if (!stream)
+      {
+        g_warning ("Failed to read picture: %s\n", error->message);
+        g_error_free (error);
+      }
+    else
+      {
+        pixbuf = gdk_pixbuf_new_from_stream_at_scale (G_INPUT_STREAM (stream), -1, 96, TRUE, NULL, NULL);
+        g_object_unref (stream);
+      }
     g_object_unref (file);
   }
 


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