summaryrefslogtreecommitdiffstats
path: root/src/Gui/ConfBackend.py
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-10-07 14:37:15 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-10-07 14:37:15 +0200
commitf23058b3dd64a35892df4a7e2e96441d4ec0c5ca (patch)
treea3deb4f270d22e0d43d21cb430476108abceda47 /src/Gui/ConfBackend.py
parentc25e034ed3b1d7ea00902831111b09c6a9c26fcb (diff)
downloadabrt-f23058b3dd64a35892df4a7e2e96441d4ec0c5ca.tar.gz
abrt-f23058b3dd64a35892df4a7e2e96441d4ec0c5ca.tar.xz
abrt-f23058b3dd64a35892df4a7e2e96441d4ec0c5ca.zip
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)
Diffstat (limited to 'src/Gui/ConfBackend.py')
-rw-r--r--src/Gui/ConfBackend.py12
1 files changed, 12 insertions, 0 deletions
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":<plugin_name>, 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: