[Sugar-devel] [PATCH] Manage the Documents folder in the VolumesToolbar

Simon Schampijer simon at schampijer.de
Mon Aug 29 10:58:11 EDT 2011


On 08/26/2011 11:51 PM, godiard at sugarlabs.org wrote:
> From: Gonzalo Odiard<godiard at gmail.com>
>
> After adding the Documents folder in the VolumesToolbar,
> if the user unmount a device with the ObjectChooser opened,
> the code break and the device button is not removed.

Thanks Gonzalo for the patch. We could as well store the mountpoint in 
DocumentsButton, the information is there. That way the 
'_get_button_for_mount' would return the correct information. What do 
you think?

Regards,
    Simon




> Signed-off-by: Gonzalo Odiard<gonzalo at laptop.org>
> ---
>   src/jarabe/journal/volumestoolbar.py |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
> index 7a34e18..36f3011 100644
> --- a/src/jarabe/journal/volumestoolbar.py
> +++ b/src/jarabe/journal/volumestoolbar.py
> @@ -280,7 +280,8 @@ class VolumesToolbar(gtk.Toolbar):
>       def _get_button_for_mount(self, mount):
>           mount_point = mount.get_root().get_path()
>           for button in self.get_children():
> -            if button.mount_point == mount_point:
> +            if hasattr(button, 'mount_point') and \
> +                button.mount_point == mount_point:
>                   return button
>           logging.error('Couldnt find button with mount_point %r', mount_point)
>           return None



More information about the Sugar-devel mailing list