Do not fail while displaying activity icon for bundles in Journal #1175

This commit is contained in:
Aleksey Lim 2009-08-14 07:17:39 +00:00 committed by Tomeu Vizoso
parent 40e9bd3ce5
commit a8ecc1729f

View File

@ -314,9 +314,21 @@ class Icon(gtk.Image):
def __init__(self, **kwargs): def __init__(self, **kwargs):
self._buffer = _IconBuffer() self._buffer = _IconBuffer()
self._file = None
gobject.GObject.__init__(self, **kwargs) 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): def _sync_image_properties(self):
if self._buffer.icon_name != self.props.icon_name: if self._buffer.icon_name != self.props.icon_name:
self._buffer.icon_name = self.props.icon_name self._buffer.icon_name = self.props.icon_name