[sugar] [PATCH] Fix frame device ordering logic

Tomeu Vizoso tomeu
Fri Oct 31 05:27:03 EDT 2008


Hi Martin,

sounds good to me, can you push it, please?

Thanks,

Tomeu

On Sun, Oct 26, 2008 at 4:34 PM, Martin Dengler
<martin at martindengler.com> wrote:
> ---
>  src/jarabe/frame/devicestray.py |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/jarabe/frame/devicestray.py b/src/jarabe/frame/devicestray.py
> index 8514efb..47a7bf5 100644
> --- a/src/jarabe/frame/devicestray.py
> +++ b/src/jarabe/frame/devicestray.py
> @@ -40,12 +40,12 @@ class DevicesTray(tray.HTray):
>
>     def add_device(self, view):
>         index = 0
> +        relative_index = getattr(view, "FRAME_POSITION_RELATIVE", -1)
>         for item in self.get_children():
> -            index = self.get_item_index(item)
> -            view_pos = getattr(view, "FRAME_POSITION_RELATIVE", -1)
> -            item_pos = getattr(item, "FRAME_POSITION_RELATIVE", 0)
> -            if view_pos < item_pos:
> +            current_relative_index = getattr(item, "FRAME_POSITION_RELATIVE", 0)
> +            if current_relative_index >= relative_index:
>                 break
> +            index += 1
>         self.add_item(view, index=index)
>         view.show()
>
> --
> 1.5.5.1
>
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>



More information about the Sugar-devel mailing list