in service discovery an item can have no name

This commit is contained in:
Yann Leboulanger 2005-03-30 20:06:01 +00:00
parent 259983a952
commit eefb01e746
2 changed files with 6 additions and 5 deletions

View File

@ -1562,8 +1562,9 @@ class Service_discovery_window:
if len(model.get_path(iter)) == 1: if len(model.get_path(iter)) == 1:
expand = True expand = True
for item in items: for item in items:
if not item.has_key('name'): name = ''
continue if item.has_key('name'):
name = item['name']
# We look if this item is already in the treeview # We look if this item is already in the treeview
iter_child = model.iter_children(iter) iter_child = model.iter_children(iter)
while iter_child: while iter_child:
@ -1571,7 +1572,7 @@ class Service_discovery_window:
break break
iter_child = model.iter_next(iter_child) iter_child = model.iter_next(iter_child)
if not iter_child: # If it is not we add it if not iter_child: # If it is not we add it
iter_child = model.append(iter, (item['name'], item['jid'])) iter_child = model.append(iter, (name, item['jid']))
self.agent_infos[item['jid']] = {'identities': [item]} self.agent_infos[item['jid']] = {'identities': [item]}
if self.iter_is_visible(iter_child) or expand: if self.iter_is_visible(iter_child) or expand:
self.browse(item['jid']) self.browse(item['jid'])

View File

@ -458,12 +458,12 @@ class plugin:
array[2], array[3]) array[2], array[3])
def handle_event_agent_info_items(self, account, array): def handle_event_agent_info_items(self, account, array):
#('AGENT_INFO', account, (agent, items)) #('AGENT_INFO_ITEMS', account, (agent, items))
if self.windows[account].has_key('browser'): if self.windows[account].has_key('browser'):
self.windows[account]['browser'].agent_info_items(array[0], array[1]) self.windows[account]['browser'].agent_info_items(array[0], array[1])
def handle_event_agent_info_info(self, account, array): def handle_event_agent_info_info(self, account, array):
#('AGENT_INFO', account, (agent, identities, features)) #('AGENT_INFO_INFO', account, (agent, identities, features))
if self.windows[account].has_key('browser'): if self.windows[account].has_key('browser'):
self.windows[account]['browser'].agent_info_info(array[0], array[1], \ self.windows[account]['browser'].agent_info_info(array[0], array[1], \
array[2]) array[2])