diff options
author | Dan Williams <dcbw@redhat.com> | 2007-07-18 06:04:01 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-07-18 06:04:01 (GMT) |
commit | 326126cbd70aa18f754779bb28d72ed517e1e7c6 (patch) | |
tree | eaab2591cc9bf6bb548e7974173afead3aaebf41 /shell | |
parent | 83a49dcd4e150fc8cdb26c92a6b1c353d00f13aa (diff) |
Suppress annoying warnings about unknown activities from the PS
Diffstat (limited to 'shell')
-rw-r--r-- | shell/model/homeactivity.py | 10 | ||||
-rw-r--r-- | shell/view/frame/FriendsBox.py | 25 |
2 files changed, 27 insertions, 8 deletions
diff --git a/shell/model/homeactivity.py b/shell/model/homeactivity.py index 4ee06d4..4487c09 100644 --- a/shell/model/homeactivity.py +++ b/shell/model/homeactivity.py @@ -113,7 +113,15 @@ class HomeActivity(gobject.GObject): colour for the icon. """ pservice = presenceservice.get_instance() - activity = pservice.get_activity(self._activity_id) + + # HACK to suppress warning in logs when activity isn't found + # (if it's locally launched and not shared yet) + activity = None + for act in pservice.get_activities(): + if self._activity_id == act.props.id: + activity = act + break + if activity != None: return XoColor(activity.props.color) else: diff --git a/shell/view/frame/FriendsBox.py b/shell/view/frame/FriendsBox.py index 18b57d3..7b7dc60 100644 --- a/shell/view/frame/FriendsBox.py +++ b/shell/view/frame/FriendsBox.py @@ -105,13 +105,24 @@ class FriendsBox(hippo.CanvasBox): 'buddy-left', self.__buddy_left_cb) def _active_activity_changed_cb(self, home_model, home_activity): - if home_activity: - activity_id = home_activity.get_activity_id() - if activity_id: - ps = self._pservice.get_activity(activity_id) - self._set_activity_ps(ps) - else: - self._set_activity_ps(None) + if not home_activity: + self._set_activity_ps(None) + return + + activity_id = home_activity.get_activity_id() + if not activity_id: + self._set_activity_ps(None) + return + + # HACK to suppress warning in logs when activity isn't found + # (if it's locally launched and not shared yet) + activity = None + for act in self._pservice.get_activities(): + if activity_id == act.props.id: + activity = act + break + if activity: + self._set_activity_ps(activity) else: self._set_activity_ps(None) |