Handle None current activity case

This commit is contained in:
Marco Pesenti Gritti 2006-09-25 19:41:08 +02:00
parent aa71d354b2
commit 57992d3fb4
2 changed files with 7 additions and 3 deletions

View File

@ -67,6 +67,10 @@ class MeshModel(gobject.GObject):
def _buddy_activity_changed_cb(self, buddy, cur_activity): def _buddy_activity_changed_cb(self, buddy, cur_activity):
buddy_model = self._buddies[buddy.get_name()] buddy_model = self._buddies[buddy.get_name()]
if cur_activity == None:
self.emit('buddy-moved', buddy_model, None)
else:
activity_model = self._activities[cur_activity.get_id()] activity_model = self._activities[cur_activity.get_id()]
self.emit('buddy-moved', buddy_model, activity_model) self.emit('buddy-moved', buddy_model, activity_model)

View File

@ -117,7 +117,7 @@ class MeshGroup(goocanvas.Group):
self._remove_buddy(buddy_model) self._remove_buddy(buddy_model)
if activity_model == None: if activity_model == None:
self.add_buddy(buddy_model) self._add_alone_buddy(buddy_model)
else: else:
activity = self._activities[activity_model.get_id()] activity = self._activities[activity_model.get_id()]