Author: asterix Date: 2008-10-04 12:20:14 +0200 (Sat, 04 Oct 2008) New Revision: 10474
Modified: trunk/src/chat_control.py trunk/src/common/config.py Log: auto-create per_option config when trying to write in a non-existing one. Fixes #4370
Modified: trunk/src/chat_control.py =================================================================== --- trunk/src/chat_control.py 2008-10-03 13:56:36 UTC (rev 10473) +++ trunk/src/chat_control.py 2008-10-04 10:20:14 UTC (rev 10474) @@ -1554,10 +1554,6 @@ ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
- gpg_pref = gajim.config.get_per('contacts', self.contact.jid, - 'gpg_enabled') - if gpg_pref is None: - gajim.config.add_per('contacts', self.contact.jid) gajim.config.set_per('contacts', self.contact.jid, 'gpg_enabled', self.gpg_is_active)
Modified: trunk/src/common/config.py =================================================================== --- trunk/src/common/config.py 2008-10-03 13:56:36 UTC (rev 10473) +++ trunk/src/common/config.py 2008-10-04 10:20:14 UTC (rev 10474) @@ -578,7 +578,7 @@ dict = self.__options_per_key[optname][1] if not dict.has_key(key): # raise RuntimeError, '%s is not a key of %s' % (key, dict) - return + self.add_per(optname, key) obj = dict[key] if not obj.has_key(subname): # raise RuntimeError, '%s is not a key of %s' % (subname, obj)