#! /bin/sh /usr/share/dpatch/dpatch-run ## 30Fix_gtkiconload.dpatch by John Church ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Prevent program crashing when gtk-execute is missing from the icon theme @DPATCH@ --- catfish-0.3.2/catfish.py 2008-10-24 01:35:21.000000000 +0100 +++ catfish-0.3.2/catfish.py 2012-01-24 12:34:44.961580714 +0000 @@ -706,9 +706,19 @@ return self.icon_cache[name] except KeyError: icon_size = gtk.icon_size_lookup(icon_size)[0] - icon = self.icon_theme.load_icon(name, icon_size, 0) - self.icon_cache[name] = icon - return icon + icon_inf = self.icon_theme.lookup_icon(name, icon_size, 0) + if(icon_inf): + try: + icon = icon_inf.load_icon(name, icon_size, 0) + self.icon_cache[name] = icon + iconf_inf.free() + return icon + except: + print "Warning: failed to load %s from icon theme" % name + return None + else: + print "Warning: %s not found in icon theme" % name + return None def get_thumbnail(self, path, icon_size=0, mime_type=None): """Try to fetch a small thumbnail."""