[Sugar-devel] [PATCH] Avoid using a protected member in the filter of the favorites view -v2

Simon Schampijer simon at schampijer.de
Tue Mar 13 08:53:15 EDT 2012


Thanks, pushed as f22a2b92143e3b09eceeb0720f05abef04f31311

Regards,
    Simon

On 03/13/2012 01:47 PM, godiard at sugarlabs.org wrote:
> From: Gonzalo Odiard<godiard at gmail.com>
>
> Implement only a getter method to access the activity name.
>
> Signed-off-by: Gonzalo Odiard<gonzalo at laptop.org>
> ---
>   src/jarabe/desktop/favoritesview.py |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
> index 5c76cdc..654f400 100644
> --- a/src/jarabe/desktop/favoritesview.py
> +++ b/src/jarabe/desktop/favoritesview.py
> @@ -115,7 +115,7 @@ class FavoritesView(hippo.Canvas):
>           query = query.strip()
>           for icon in self._box.get_children():
>               if icon not in [self._my_icon, self._current_activity]:
> -                activity_name = icon._activity_info.get_name().lower()
> +                activity_name = icon.get_activity_name().lower()
>                   if activity_name.find(query)>  -1:
>                       icon.alpha = 1.0
>                   else:
> @@ -508,6 +508,9 @@ class ActivityIcon(CanvasIcon):
>           return self._activity_info.get_activity_version()
>       version = property(get_version, None)
>
> +    def get_activity_name(self):
> +        return self._activity_info.get_name()
> +
>       def _get_installation_time(self):
>           return self._activity_info.get_installation_time()
>       installation_time = property(_get_installation_time, None)



More information about the Sugar-devel mailing list