Handle None current activity case
This commit is contained in:
parent
aa71d354b2
commit
57992d3fb4
@ -67,8 +67,12 @@ 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()]
|
||||||
activity_model = self._activities[cur_activity.get_id()]
|
|
||||||
self.emit('buddy-moved', buddy_model, activity_model)
|
if cur_activity == None:
|
||||||
|
self.emit('buddy-moved', buddy_model, None)
|
||||||
|
else:
|
||||||
|
activity_model = self._activities[cur_activity.get_id()]
|
||||||
|
self.emit('buddy-moved', buddy_model, activity_model)
|
||||||
|
|
||||||
def _buddy_appeared_cb(self, pservice, buddy):
|
def _buddy_appeared_cb(self, pservice, buddy):
|
||||||
model = BuddyModel(buddy=buddy)
|
model = BuddyModel(buddy=buddy)
|
||||||
|
@ -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()]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user