[Sugar-devel] [PATCH sugar] Friendstray: make sure the tray is right on the sharer side OLPC #10817

Sascha Silbe sascha-ml-reply-to-2011-3 at silbe.org
Sat Jul 23 13:38:26 EDT 2011


Excerpts from Simon Schampijer's message of Mon Jul 04 17:08:11 +0200 2011:

[...]
> Yes, this all is true.

It would be nice if this (the explanation of what's going on and why)
were reflected in the patch description.

[src/jarabe/frame/friendstray.py]
> >> @@ -75,6 +75,10 @@ class FriendsTray(VTray):
> >>       def __neighborhood_activity_added_cb(self, neighborhood_model,
> >>                                            shared_activity):
> >>           logging.debug('FriendsTray.__neighborhood_activity_added_cb')
> >> +        active_activity = shell.get_model().get_active_activity()
> >> +        if active_activity.get_activity_id() != shared_activity.activity_id:
> >> +            return
> >> +
> >
> > With the above understanding, shouldn't we reset self._shared_activity
> > to None in __active_activity_changed_cb() and add the following check
> > before yours?
> >
> >          if self._shared_activity is not None:
> >              return
> 
> So my check prevents on any other machine then the sharer machine the 
> neighborhood:activity-added to have any effect. All the rest should work 
> fine. AFAIK your addition is not needed, from testing and looking at the 
> code. But maybe I do oversee something, can you explain which exact case 
> it should fix?

I don't think it fixes anything right now. But IMO it makes it clearer
what we're doing. It also makes the code more robust in the light of
future changes.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 500 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110723/89ddeea8/attachment.pgp>


More information about the Sugar-devel mailing list