From feab799c3e67618acab6d7d2a9f85fda87b396db Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 4 Oct 2008 10:20:14 +0000 Subject: [PATCH] auto-create per_option config when trying to write in a non-existing one. Fixes #4370 --- src/chat_control.py | 4 ---- src/common/config.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index fdde777aa..1c3ec68f4 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -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) diff --git a/src/common/config.py b/src/common/config.py index 695702afa..efb838799 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -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)