[gitg] Set default avatar icon if avatar not found



commit 6fe5dc00cd3256dd357cf4e8b5782a719ca17349
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Wed Jun 25 14:30:30 2014 +0200

    Set default avatar icon if avatar not found

 gitg/commit/gitg-commit-dialog.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala
index d79bbdb..91712ea 100644
--- a/gitg/commit/gitg-commit-dialog.vala
+++ b/gitg/commit/gitg-commit-dialog.vala
@@ -341,10 +341,19 @@ class Dialog : Gtk.Dialog
                ac.load.begin(d_author.get_email(), d_cancel_avatar, (obj, res) => {
                        var pixbuf = ac.load.end(res);
 
-                       if (pixbuf != null && !d_cancel_avatar.is_cancelled())
+                       if (d_cancel_avatar.is_cancelled())
+                       {
+                               return;
+                       }
+
+                       if (pixbuf != null)
                        {
                                d_image_avatar.set_from_pixbuf(pixbuf);
                        }
+                       else
+                       {
+                               d_image_avatar.set_from_icon_name("avatar-default-symbolic", 
Gtk.IconSize.DIALOG);
+                       }
                });
        }
 


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