From 42155c344eb8680fad25541575d4c3b9d9209b5b Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Thu, 28 Sep 2006 01:47:30 +0000 Subject: [PATCH] Calculate icons path only when needed --- src/tooltips.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/tooltips.py b/src/tooltips.py index 035aa0d45..2c9f2adad 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -462,15 +462,6 @@ class RosterTooltip(NotificationAreaTooltip): prim_contact = gajim.contacts.get_highest_prio_contact_from_contacts( contacts) - transport = gajim.get_transport_name_from_jid(prim_contact.jid) - if transport: - file_path = os.path.join(gajim.DATA_DIR, 'iconsets', 'transports', - transport , '16x16') - else: - iconset = gajim.config.get('iconset') - if not iconset: - iconset = 'dcraven' - file_path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') puny_jid = helpers.sanitize_filename(prim_contact.jid) table_size = 3 @@ -506,6 +497,17 @@ class RosterTooltip(NotificationAreaTooltip): contacts_dict[contact.priority] = [contact] if num_resources > 1: properties.append((_('Status: '), ' ')) + transport = gajim.get_transport_name_from_jid(prim_contact.jid) + if transport: + file_path = os.path.join(gajim.DATA_DIR, 'iconsets', + 'transports', transport , '16x16') + else: + iconset = gajim.config.get('iconset') + if not iconset: + iconset = 'dcraven' + file_path = os.path.join(gajim.DATA_DIR, + 'iconsets', iconset, '16x16') + contact_keys = contacts_dict.keys() contact_keys.sort() contact_keys.reverse()