[Sugar-devel] [PATCH] Don't emit buddy-removed and activity-removed before they have announced #2401
Tomeu Vizoso
tomeu.vizoso at collabora.co.uk
Mon Oct 4 13:50:28 EDT 2010
On Mon, Oct 4, 2010 at 19:44, Tomeu Vizoso <tomeu.vizoso at collabora.co.uk> wrote:
> Otherwise we'll get some tracebacks from the listeners of those
> signals because they still don't know about those buddies or activities.
Requesting inclusion in 0.90.
Thanks,
Tomeu
> ---
> src/jarabe/model/neighborhood.py | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
> index ed23f7f..478ee46 100644
> --- a/src/jarabe/model/neighborhood.py
> +++ b/src/jarabe/model/neighborhood.py
> @@ -858,7 +858,9 @@ class Neighborhood(gobject.GObject):
>
> buddy = self._buddies[contact_id]
> del self._buddies[contact_id]
> - self.emit('buddy-removed', buddy)
> +
> + if buddy.props.key is not None:
> + self.emit('buddy-removed', buddy)
>
> def __activity_added_cb(self, account, room_handle, activity_id):
> logging.debug('__activity_added_cb %r %r', room_handle, activity_id)
> @@ -902,7 +904,9 @@ class Neighborhood(gobject.GObject):
> return
> activity = self._activities[activity_id]
> del self._activities[activity_id]
> - self.emit('activity-removed', activity)
> +
> + if activity.props.bundle is not None:
> + self.emit('activity-removed', activity)
>
> def __current_activity_updated_cb(self, account, contact_id, activity_id):
> logging.debug('__current_activity_updated_cb %r %r', contact_id,
> --
> 1.7.2.3
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
More information about the Sugar-devel
mailing list