Commit 58512300 authored by nkour's avatar nkour
Browse files

make sure we do not fail if path to iconset no longer exists. fixes #2444

parent 65fc27e5
......@@ -37,6 +37,8 @@ opt_bool = [ 'boolean', 0 ]
opt_color = [ 'color', '^(#[0-9a-fA-F]{6})|()$' ]
opt_one_window_types = ['never', 'always', 'peracct', 'pertype']
DEFAULT_ICONSET = 'dcraven'
class Config:
__options = {
......@@ -67,7 +69,7 @@ class Config:
'last_status_msg_invisible': [ opt_str, '' ],
'last_status_msg_offline': [ opt_str, '' ],
'trayicon': [ opt_bool, True, '', True ],
'iconset': [ opt_str, 'dcraven', '', True ],
'iconset': [ opt_str, DEFAULT_ICONSET, '', True ],
'use_transports_iconsets': [ opt_bool, True, '', True ],
'inmsgcolor': [ opt_color, '#a34526', '', True ],
'outmsgcolor': [ opt_color, '#164e6f', '', True ],
......
......@@ -3129,9 +3129,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
def make_jabber_state_images(self):
'''initialise jabber_state_images dict'''
iconset = gajim.config.get('iconset')
if not iconset:
iconset = 'dcraven'
path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '32x32')
if iconset:
path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '32x32')
if not os.path.exists(path):
iconset = DEFAULT_ICONSET
else:
iconset = DEFAULT_ICONSET
self.jabber_state_images['32'] = self.load_iconset(path)
path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment