summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Preferences.H6
-rw-r--r--src/Fl_Preferences.cxx4
2 files changed, 6 insertions, 4 deletions
diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H
index e734d7d23..b5dffe14c 100644
--- a/FL/Fl_Preferences.H
+++ b/FL/Fl_Preferences.H
@@ -100,7 +100,9 @@ public:
Fl_Preferences( ID id );
~Fl_Preferences();
- ID id();
+ /** Return an ID that can later be reused to open more references to this dataset.
+ */
+ ID id() { return (ID)node; }
/** Return the name of this entry.
*/
@@ -212,7 +214,7 @@ private:
Node *search( const char *path, int offset=0 );
Node *addChild( const char *path );
void setParent( Node *parent );
- Node *parent() { return top_?parent_:0L; }
+ Node *parent() { return top_?0L:parent_; }
void setRoot(RootNode *r) { root_ = r; top_ = 1; }
RootNode *findRoot();
char remove();
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 41dd90c00..a1c332465 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -161,8 +161,8 @@ const char *Fl_Preferences::newUUID()
*/
Fl_Preferences::Fl_Preferences( Root root, const char *vendor, const char *application )
{
- rootNode = new RootNode( this, root, vendor, application );
node = new Node( "." );
+ rootNode = new RootNode( this, root, vendor, application );
node->setRoot(rootNode);
}
@@ -181,8 +181,8 @@ Fl_Preferences::Fl_Preferences( Root root, const char *vendor, const char *appli
*/
Fl_Preferences::Fl_Preferences( const char *path, const char *vendor, const char *application )
{
- rootNode = new RootNode( this, path, vendor, application );
node = new Node( "." );
+ rootNode = new RootNode( this, path, vendor, application );
node->setRoot(rootNode);
}