[Java-gnome-developer] Problem getting change notifications from GConf
Brought to you by:
afcowie
From: Pierre-Charles D. <pc...@gm...> - 2006-11-27 10:23:11
|
Hi all, I'm trying to use the gconf bindings (libgconf-java-2.12.5) from Java. It works well when requesting values, but I can't seem to get notifications of changes. I'm new both to java-gnome and gconf itself, so I may be missing something obvious. Below is the code I am running. While it is waiting on the last line, I run gconf-editor and manually change the (boolean) value of the key "/apps/baobab/properties/enable_home_monitor"; I was expecting my listener to be called, but it is not. Am I doing something wrong / misunderstanding gconf, or is this feature not supported yet? Thanks in advance. public static void main(String[] args) throws Exception { ConfClient cc = ConfClient.getInstance(); cc.addDirectory("/apps/baobab/properties", ConfClientPreloadType.RECURSIVE); System.out.println(cc.get("/apps/baobab/properties/enable_home_monitor")); cc.addListener(new ConfClientListener() { public void clientNotify(ConfEntry entry) { System.out.println(entry.getKey() + " = " + entry.getValue()); } }, "/apps/baobab/properties"); new BufferedReader(new InputStreamReader(System.in)).readLine(); } |