[gnome-control-center/useraccounts-fixups: 1/2] user-accounts: Always generate user avatars



commit 61dc4489defe8cd1e978addcb27f2615980a2832
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Feb 11 14:14:38 2020 +0100

    user-accounts: Always generate user avatars
    
    Never fallback to default-user avatar icons.
    
    See #859

 panels/user-accounts/cc-user-image.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/panels/user-accounts/cc-user-image.c b/panels/user-accounts/cc-user-image.c
index 26a430d44..8dc6389aa 100644
--- a/panels/user-accounts/cc-user-image.c
+++ b/panels/user-accounts/cc-user-image.c
@@ -39,7 +39,6 @@ render_user_icon (ActUser *user,
 {
         g_autoptr(GdkPixbuf) source_pixbuf = NULL;
         GdkPixbuf    *pixbuf = NULL;
-        GError       *error;
         const gchar  *icon_file;
         cairo_surface_t *surface = NULL;
 
@@ -61,17 +60,13 @@ render_user_icon (ActUser *user,
                 goto out;
         }
 
-        error = NULL;
-        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
-                                           "avatar-default",
-                                           icon_size * scale,
-                                           GTK_ICON_LOOKUP_FORCE_SIZE,
-                                           &error);
-        if (error) {
-                g_warning ("%s", error->message);
-                g_error_free (error);
+        if (source_pixbuf != NULL) {
+                g_object_unref (source_pixbuf);
         }
 
+        source_pixbuf = generate_default_avatar (user, icon_size * scale);
+        if (source_pixbuf)
+            pixbuf = round_image (source_pixbuf);
  out:
 
         if (pixbuf != NULL) {


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