From f23058b3dd64a35892df4a7e2e96441d4ec0c5ca Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 7 Oct 2009 14:37:15 +0200 Subject: fixed saving/reading user config - if user changes else then the password, the keyring was duped and the next time the old one was returned, so we need to make sure that the keyring is only updated (so far by removing the old one and creating a new one) --- src/Gui/ConfBackend.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py index e0f6434..eb94b87 100644 --- a/src/Gui/ConfBackend.py +++ b/src/Gui/ConfBackend.py @@ -33,6 +33,17 @@ class ConfBackendGnomeKeyring(ConfBackend): settings_tmp["AbrtPluginInfo"] = name password = "" + item_list = [] + try: + item_list = gkey.find_items_sync(gkey.ITEM_GENERIC_SECRET, {"AbrtPluginInfo":str(name)}) + except gkey.NoMatchError, ex: + # nothing found + pass + + # delete all items containg "AbrtPluginInfo":, so we always have only 1 item per plugin + for item in item_list: + gkey.item_delete_sync(self.default_key_ring, item.item_id) + if "Password" in settings_tmp: password = settings_tmp["Password"] del settings_tmp["Password"] @@ -43,6 +54,7 @@ class ConfBackendGnomeKeyring(ConfBackend): password, True) + def load(self, name): item_list = None try: -- cgit