[Sugar-devel] [PATCH sugar] Cache the XO palette in the Home View, part of #2726

Simon Schampijer simon at schampijer.de
Thu Mar 24 16:16:32 EDT 2011


Since we do not cache the palette for the BuddyIcon anymore,
we as well do not cache the Owner palette in the Favorites view.
The current code tries to change the register menu (school server)
in the palette when successfully registered (label it 'register again').
But the palette has been destroyed and therefore this attempt
fails.

The patch does cache the palette of the Owner, this has been
the behavior before 356641c332d6cc889b265dfc29598004cf37763c. As
registering (and therefore the change of the palette) happens
rather seldom compared to the change of a buddy palette, I think
the Owner palette can be considered to be mostly static
and therefore we can cache it.

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 src/jarabe/desktop/favoritesview.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
index b4a4e75..b609b1b 100644
--- a/src/jarabe/desktop/favoritesview.py
+++ b/src/jarabe/desktop/favoritesview.py
@@ -610,6 +610,8 @@ class OwnerIcon(BuddyIcon):
     def __init__(self, size):
         BuddyIcon.__init__(self, buddy=get_owner_instance(), size=size)
 
+        self.palette_invoker.cache_palette = True
+
         self._palette_enabled = False
         self._register_menu = None
 
-- 
1.7.4



More information about the Sugar-devel mailing list