Merge lp:~ken-vandine/gwibber/lp_940182 into lp:gwibber

Proposed by Ken VanDine
Status: Merged
Merged at revision: 1330
Proposed branch: lp:~ken-vandine/gwibber/lp_940182
Merge into: lp:gwibber
Diff against target: 23 lines (+7/-1)
1 file modified
gwibber/microblog/util/__init__.py (+7/-1)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/lp_940182
Reviewer Review Type Date Requested Status
David Klasinc (community) Approve
Review via email: mp+100141@code.launchpad.net

Description of the change

Can errors for creating the pixbuf separately from sending the notification (LP: #940182)

To post a comment you must log in.
lp:~ken-vandine/gwibber/lp_940182 updated
1326. By Ken VanDine

only try to set the notification pixbuf if we have a valid pixbuf

Revision history for this message
David Klasinc (bigwhale) wrote :

Looks ok.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gwibber/microblog/util/__init__.py'
2--- gwibber/microblog/util/__init__.py 2012-03-20 16:31:03 +0000
3+++ gwibber/microblog/util/__init__.py 2012-03-30 14:32:22 +0000
4@@ -230,13 +230,19 @@
5
6 notification = Notify.Notification.new(title, text, "gwibber")
7
8+ pixbuf = None
9 try:
10 pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(icon, iconsize, iconsize)
11- notification.set_icon_from_pixbuf(pixbuf)
12 except GLib.Error as e:
13 logger.error("Avatar failure - %s - %s", icon, e.message)
14 resources.del_avatar(icon)
15
16+ if pixbuf:
17+ try:
18+ notification.set_icon_from_pixbuf(pixbuf)
19+ except GLib.Error as e:
20+ logger.error("Notification failure - %s", e.message)
21+
22 if timeout:
23 notification.set_timeout(timeout)
24