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

godiard at sugarlabs.org godiard at sugarlabs.org
Tue Mar 13 08:47:23 EDT 2012


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)
-- 
1.7.7.6



More information about the Sugar-devel mailing list