user-accounts: Always generate user avatars

Never fallback to default-user avatar icons.

See #859
This commit is contained in:
Felipe Borges 2020-02-11 14:14:38 +01:00
parent 1fbd342fc1
commit 61dc4489de

View file

@ -39,7 +39,6 @@ render_user_icon (ActUser *user,
{ {
g_autoptr(GdkPixbuf) source_pixbuf = NULL; g_autoptr(GdkPixbuf) source_pixbuf = NULL;
GdkPixbuf *pixbuf = NULL; GdkPixbuf *pixbuf = NULL;
GError *error;
const gchar *icon_file; const gchar *icon_file;
cairo_surface_t *surface = NULL; cairo_surface_t *surface = NULL;
@ -61,17 +60,13 @@ render_user_icon (ActUser *user,
goto out; goto out;
} }
error = NULL; if (source_pixbuf != NULL) {
pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), g_object_unref (source_pixbuf);
"avatar-default",
icon_size * scale,
GTK_ICON_LOOKUP_FORCE_SIZE,
&error);
if (error) {
g_warning ("%s", error->message);
g_error_free (error);
} }
source_pixbuf = generate_default_avatar (user, icon_size * scale);
if (source_pixbuf)
pixbuf = round_image (source_pixbuf);
out: out:
if (pixbuf != NULL) { if (pixbuf != NULL) {