From 2602e4efbbf4cdcf4281cf28e96fdc918ecd46da Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 27 May 2015 19:08:16 +0200 Subject: [PATCH] quick frontends (contact list): cache is not cleared anymore on QuickContactList.fill, avoiding the accidental removal of cached values like avatars --- frontends/src/quick_frontend/quick_contact_list.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index 0b402f53..1f0f64d7 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -139,7 +139,7 @@ class QuickContactList(QuickWidget): Contacts will be cleared before refilling them """ - self.clearContacts() + self.clearContacts(keep_cache=True) def gotContacts(contacts): for contact in contacts: self.host.newContactHandler(*contact, profile=self.profile) @@ -259,10 +259,14 @@ class QuickContactList(QuickWidget): return self._special_extras return set([extra for extra in self._special_extras if extra.bare in self.getSpecials(special_type)]) - def clearContacts(self): - """Clear all the contact list""" + def clearContacts(self, keep_cache=False): + """Clear all the contact list + + @param keep_cache: if True, don't reset the cache + """ self.unselectAll() - self._cache.clear() + if not keep_cache: + self._cache.clear() self._groups.clear() self._specials.clear() self._special_extras.clear()