summaryrefslogtreecommitdiffstats
path: root/gconf
diff options
context:
space:
mode:
Diffstat (limited to 'gconf')
-rw-r--r--gconf/config.py7
-rw-r--r--gconf/main.py4
2 files changed, 11 insertions, 0 deletions
diff --git a/gconf/config.py b/gconf/config.py
index 4c0ec8c..b8b2bfe 100644
--- a/gconf/config.py
+++ b/gconf/config.py
@@ -45,6 +45,9 @@ class Config(ibus.Object):
def set_bool(self, key, value):
pass
+ def do_destroy(self):
+ self.__proxy = None
+
def __value_changed_cb(self, gconf, key, value):
value = self.__client.get_value(key)
print key, type(value), value
@@ -68,3 +71,7 @@ class ConfigProxy(interface.IConfig):
self.__config.set_int(key, value)
def SetBool(self, key, value):
self.__config.set_bool(key, value)
+ def Destroy(self):
+ self.remove_from_connection()
+ self.__config.destroy()
+ self.__config = None
diff --git a/gconf/main.py b/gconf/main.py
index e5d81d6..a96ebe7 100644
--- a/gconf/main.py
+++ b/gconf/main.py
@@ -35,12 +35,16 @@ class GconfApplication:
self.__ibus.call_on_disconnection(self.__disconnected_cb)
self.__config = config.Config(self.__ibus, CONFIG_PATH)
+ self.__config.connect("destroy", self.__config_destroy_cb)
self.__ibus.register_config(CONFIG_PATH, True)
def run(self):
self.__mainloop.run()
+ def __config_destroy_cb(self, config):
+ self.__mainloop.quit()
+
def __disconnected_cb(self, conn):
print "disconnected"
self.__mainloop.quit()