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

Sascha Silbe sascha-ml-reply-to-2011-3 at silbe.org
Sat Jun 18 14:56:29 EDT 2011

Excerpts from godiard's message of Fri Jun 17 16:20:03 +0200 2011:

> @@ -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):

As Martin mentioned, we should do the same for the updated and deleted
callbacks. In the long run we should probably update the model instead
of doing a complete rescan on every change.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110618/dbc521c9/attachment.pgp>

More information about the Sugar-devel mailing list