[pitivi: 2/3] effects: Clean up the way we load effect icons
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 2/3] effects: Clean up the way we load effect icons
- Date: Fri, 21 Jan 2011 10:08:42 +0000 (UTC)
commit d8aad47786a683f54bae58ade97efcf8c09890d0
Author: Thibault Saunier <thibault saunier collabora co uk>
Date: Fri Jan 21 09:40:43 2011 +0100
effects: Clean up the way we load effect icons
pitivi/effects.py | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 7e85bf9..3e95845 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -291,20 +291,19 @@ class EffectsHandler(object):
return effects_categories.extended(self.video_categories).extended(self.audio_categories)
def getEffectIcon(self, effect_name):
- icontheme = gtk.icon_theme_get_default()
pixdir = get_pixmap_dir()
+ effect_name = effect_name + ".png"
icon = None
try:
- icon = icontheme.load_icon(effect_name, 32, 0)
+ icon = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, effect_name))
+ # empty except clause is bad but load_icon raises gio.Error.
+ ## Right, *gio*.
except:
- # empty except clause is bad but load_icon raises gio.Error.
- ## Right, *gio*.
- if not icon:
- effect_name = effect_name + ".png"
- try:
- icon = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, effect_name))
- except:
- icon = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, "defaultthumbnail.svg"))
+ try:
+ icon = gtk.gdk.pixbuf_new_from_file(os.path.join(pixdir, "defaultthumbnail.svg"))
+ except:
+ return None
+
return icon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]