Merged gcj-eclipse branch to trunk.
From-SVN: r120621
This commit is contained in:
@@ -72,7 +72,6 @@ import java.util.prefs.BackingStoreException;
|
||||
* <br />
|
||||
*
|
||||
* @author Mario Torre <neugens@limasoftware.net>
|
||||
* @version 1.0.1
|
||||
*/
|
||||
public class GConfBasedPreferences
|
||||
extends AbstractPreferences
|
||||
@@ -136,12 +135,20 @@ public class GConfBasedPreferences
|
||||
absolutePath = absolutePath.substring(0, absolutePath.length() - 1);
|
||||
}
|
||||
|
||||
// strip invalid characters
|
||||
// please, note that all names are unescaped into the native peer
|
||||
int index = absolutePath.lastIndexOf('/');
|
||||
if (index > -1)
|
||||
{
|
||||
absolutePath = absolutePath.substring(0, index + 1);
|
||||
absolutePath = absolutePath + GConfNativePeer.escapeString(name);
|
||||
}
|
||||
|
||||
this.node = this.getRealRoot(isUser) + absolutePath;
|
||||
|
||||
boolean nodeExist = backend.nodeExist(this.node);
|
||||
|
||||
this.newNode = !nodeExist;
|
||||
backend.startWatchingNode(this.node);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +163,15 @@ public class GConfBasedPreferences
|
||||
// we don't check anything here, if the node is a new node this will be
|
||||
// detected in the constructor, so we simply return a new reference to
|
||||
// the requested node.
|
||||
return new GConfBasedPreferences(this, name, this.isUser);
|
||||
|
||||
GConfBasedPreferences preferenceNode
|
||||
= new GConfBasedPreferences(this, name, this.isUser);
|
||||
|
||||
// register the node for to GConf so that it can listen
|
||||
// events outside the scope of the application
|
||||
backend.startWatchingNode(this.node);
|
||||
|
||||
return preferenceNode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,6 +380,10 @@ public class GConfBasedPreferences
|
||||
{
|
||||
String nodeName = "";
|
||||
|
||||
// strip key
|
||||
// please, note that all names are unescaped into the native peer
|
||||
key = GConfNativePeer.escapeString(key);
|
||||
|
||||
if (this.node.endsWith("/"))
|
||||
{
|
||||
nodeName = this.node + key;
|
||||
@@ -373,7 +392,7 @@ public class GConfBasedPreferences
|
||||
{
|
||||
nodeName = this.node + "/" + key;
|
||||
}
|
||||
|
||||
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user