quick frontend (app): create the contact list immediatly on plug
This avoid crash when contact list is used while connexion is not done yet or not possible (e.g. server unavailable).
This commit is contained in:
parent
18a4d3d544
commit
154ba0d349
1 changed files with 4 additions and 2 deletions
|
|
@ -73,6 +73,9 @@ class ProfileManager(object):
|
|||
|
||||
def plug(self):
|
||||
"""Plug the profile to the host"""
|
||||
# first of all we create the contact lists
|
||||
self.host.contact_lists.addProfile(self.profile)
|
||||
|
||||
# we get the essential params
|
||||
self.bridge.asyncGetParamA(
|
||||
"JabberID",
|
||||
|
|
@ -155,9 +158,8 @@ class ProfileManager(object):
|
|||
self._plug_profile_gotCachedValues({})
|
||||
|
||||
def _plug_profile_gotCachedValues(self, cached_values):
|
||||
contact_list = self.host.contact_lists[self.profile]
|
||||
# add the contact list and its listener
|
||||
contact_list = self.host.contact_lists.addProfile(self.profile)
|
||||
|
||||
for entity_s, data in cached_values.iteritems():
|
||||
for key, value in data.iteritems():
|
||||
self.host.entityDataUpdatedHandler(entity_s, key, value, self.profile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue