[Sugar-devel] [PATCH] Journal: Do not rescan external device if is not needed - OLPC #10841

Martin Abente martin.abente.lahaye at gmail.com
Sat Jun 18 15:14:07 EDT 2011


On Sat, Jun 18, 2011 at 2:56 PM, Sascha Silbe
<sascha-ml-reply-to-2011-3 at silbe.org> wrote:
> Excerpts from godiard's message of Fri Jun 17 16:20:03 +0200 2011:
>
> [src/jarabe/journal/listview.py]
>> @@ -118,7 +118,8 @@ class BaseListView(gtk.Bin):
>>          model.deleted.connect(self.__model_deleted_cb)
>>
>>      def __model_created_cb(self, sender, **kwargs):
>> -        self._set_dirty()
>> +        if self._is_new_item_visible(kwargs):
>> +            self._set_dirty()
>
> If we use the additional keyword arguments, we should explicitly list
> them in the parameter list. I.e.:
>
>
>     def __model_created_cb(self, sender, object_id):
>         if self._is_item_visible(object_id):
>             self._set_dirty()
>
> As Martin mentioned, we should do the same for the updated and deleted
> callbacks.

Please do!

> In the long run we should probably update the model instead
> of doing a complete rescan on every change.
>

+1, sorry for mixing topics, but that will help to simplify the
multi-selection implementation too.

> Sascha
>
> --
> http://sascha.silbe.org/
> http://www.infra-silbe.de/
>
> _______________________________________________
> 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