diff options
author | Andrew Resch <andrewresch@gmail.com> | 2010-07-15 19:17:17 -0700 |
---|---|---|
committer | Andrew Resch <andrewresch@gmail.com> | 2010-07-15 19:17:48 -0700 |
commit | 007a9912d26e549197c24977d5678bb7d5c9df2e (patch) | |
tree | 25bf8f0176534785a06b753e71659efbe33f60b0 | |
parent | d793b9e6b8e4fabb78175a9b5d0d137ee8da98fb (diff) | |
download | deluge-007a9912d26e549197c24977d5678bb7d5c9df2e.tar.gz deluge-007a9912d26e549197c24977d5678bb7d5c9df2e.tar.bz2 deluge-007a9912d26e549197c24977d5678bb7d5c9df2e.zip |
Use a blank icon when the tracker icon downloaded isn't a proper image
-rw-r--r-- | deluge/ui/gtkui/torrentview.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index bc1b90893..07bfa6065 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -88,14 +88,18 @@ def cell_data_statusicon(column, cell, model, row, data): def cell_data_trackericon(column, cell, model, row, data): def on_get_icon(icon): + def create_blank_icon(): + i = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16) + i.fill(0x00000000) + return i + if icon: try: icon = gtk.gdk.pixbuf_new_from_file_at_size(icon.get_filename(), 16, 16) except Exception, e: - pass + icon = create_blank_icon() else: - icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16) - icon.fill(0x00000000) + icon = create_blank_icon() if cell.get_property("pixbuf") != icon: cell.set_property("pixbuf", icon) |