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

Simon Schampijer simon at schampijer.de
Sun Jul 24 10:04:26 EDT 2011


On 07/24/2011 03:42 PM, Simon Schampijer wrote:
> On 07/23/2011 07:38 PM, Sascha Silbe wrote:
>> 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.
>
> Hmm, ok - I don't see it as being needed. I would say we just go ahead
> with the patch, it is tested and it works, imho it is clear what it does.
>
> Regards,
> Simon

After ack from silbe on irc:

http://git.sugarlabs.org/sugar/mainline/commit/fd857d85d711ce8f80ef09aba492cad0c773d40b

http://git.sugarlabs.org/sugar/mainline/commit/7ccbfb2da266004d149e89020eda01ae50bcaee7

Regards,
    Simon


More information about the Sugar-devel mailing list