From 6c0ebcba31940fe8b622eafeb7aa96e5209f5738 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Thu, 22 Oct 2009 16:56:00 +0200 Subject: GUI: fixed problem with keyring when run after "su -" - keyring daemon works only for the session owner so, if user "su" to other user abrt will fail to read/write any settings and will load the defaults, user still can change the settings and use them, but it will be lost when he quit the gui --- src/Gui/ABRTPlugin.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/Gui/ABRTPlugin.py') diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py index 8d687f83..8483be44 100644 --- a/src/Gui/ABRTPlugin.py +++ b/src/Gui/ABRTPlugin.py @@ -11,12 +11,17 @@ Email Description """ from abrt_utils import _ -from ConfBackend import ConfBackendGnomeKeyring +from ConfBackend import ConfBackendGnomeKeyring, ConfBackendInitError class PluginSettings(dict): def __init__(self): dict.__init__(self) - self.conf = ConfBackendGnomeKeyring() + self.conf = None + try: + self.conf = ConfBackendGnomeKeyring() + except ConfBackendInitError, e: + print e + pass def check(self): for key in ["Password", "Login"]: @@ -32,16 +37,18 @@ class PluginSettings(dict): for key in default_settings.keys(): self[str(key)] = str(default_settings[key]) - settings = self.conf.load(name) - # overwrite defaluts with user setting - for key in settings.keys(): - # only rewrite keys needed by the plugin - # e.g we don't want a pass field for logger - if key in default_settings.keys(): - self[str(key)] = str(settings[key]) + if self.conf: + settings = self.conf.load(name) + # overwrite defaluts with user setting + for key in settings.keys(): + # only rewrite keys needed by the plugin + # e.g we don't want a pass field for logger + if key in default_settings.keys(): + self[str(key)] = str(settings[key]) def save(self, name): - self.conf.save(name, self) + if self.conf: + self.conf.save(name, self) class PluginInfo(): """Class to represent common plugin info""" -- cgit