auto-create per_option config when trying to write in a non-existing one. Fixes #4370

This commit is contained in:
Yann Leboulanger 2008-10-04 10:20:14 +00:00
parent b4e30ff003
commit feab799c3e
2 changed files with 1 additions and 5 deletions

View File

@ -1554,10 +1554,6 @@ class ChatControl(ChatControlBase):
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)

View File

@ -578,7 +578,7 @@ class Config:
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)