Merge lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf into lp:~elementary-pantheon/switchboard-plug-useraccounts/trunk

Proposed by Corentin Noël
Status: Needs review
Proposed branch: lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf
Merge into: lp:~elementary-pantheon/switchboard-plug-useraccounts/trunk
Diff against target: 20 lines (+4/-6)
1 file modified
src/Widgets/UserItem.vala (+4/-6)
To merge this branch: bzr merge lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Needs Information
Review via email: mp+313496@code.launchpad.net

Description of the change

Don't use pixbufs

To post a comment you must log in.
264. By Corentin Noël

Use the image files directly

Revision history for this message
Zisu Andrei (matzipan) wrote :

1 comment inline

review: Needs Information
Revision history for this message
Corentin Noël (tintou) wrote :

widget.destroy () != delete (widget)
https://valadoc.org/gtk+-3.0/Gtk.Widget.destroy.html
It just kindly ask its container to release it, which results in freeing it.
But you're right for the null-check

Unmerged revisions

264. By Corentin Noël

Use the image files directly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/UserItem.vala'
--- src/Widgets/UserItem.vala 2015-10-18 22:49:57 +0000
+++ src/Widgets/UserItem.vala 2016-12-17 20:43:31 +0000
@@ -59,12 +59,10 @@
59 }59 }
6060
61 public void update_ui () {61 public void update_ui () {
62 try {62 var new_avatar = new Granite.Widgets.Avatar.from_file (user.get_icon_file (), 32);
63 var avatar_pixbuf = new Gdk.Pixbuf.from_file_at_scale (user.get_icon_file (), 32, 32, true);63 grid.attach (new_avatar, 0, 0, 1, 2);
64 avatar.pixbuf = avatar_pixbuf;64 avatar.destroy ();
65 } catch (Error e) {65 avatar = new_avatar;
66 avatar.show_default (32);
67 }
6866
69 full_name_label.label = user.get_real_name ();67 full_name_label.label = user.get_real_name ();
70 username_label.label = "<span font_size=\"small\">%s</span>".printf (GLib.Markup.escape_text (user.get_user_name ()));68 username_label.label = "<span font_size=\"small\">%s</span>".printf (GLib.Markup.escape_text (user.get_user_name ()));

Subscribers

People subscribed via source and target branches

to all changes: