From 326ecb245b6020d9508c17bee07761d6b9a1dc21 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 14 Aug 2009 07:17:39 +0000 Subject: Do not fail while displaying activity icon for bundles in Journal #1175 --- (limited to 'src') diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py index 6e88f88..57c53f5 100644 --- a/src/sugar/graphics/icon.py +++ b/src/sugar/graphics/icon.py @@ -314,9 +314,21 @@ class Icon(gtk.Image): def __init__(self, **kwargs): self._buffer = _IconBuffer() + self._file = None gobject.GObject.__init__(self, **kwargs) + def get_file(self): + return self._file + + def set_file(self, file_name): + self._file = file_name + self._buffer.file_name = file_name + + # XXX we need to override file property to support auto_ptr objects + # that used to represent temporaly unzipped icons from bundles, see #1175 + file = gobject.property(type=object, setter=set_file, getter=get_file) + def _sync_image_properties(self): if self._buffer.icon_name != self.props.icon_name: self._buffer.icon_name = self.props.icon_name -- cgit v0.9.1