Index: branches/preferences/src/lib/util/preferences.cc
===================================================================
--- branches/preferences/src/lib/util/preferences.cc	(revision 7243)
+++ branches/preferences/src/lib/util/preferences.cc	(revision 7244)
@@ -28,5 +28,5 @@
    this->setClassID(CL_PREFERENCES, "Preferences");
    this->setName("Preferences");
-   this->fileName = NULL;
+   this->fileName = "";
 }
 
@@ -42,10 +42,4 @@
 {
   Preferences::singletonRef = NULL;
-
-  if ( this->fileName )
-  {
-    delete this->fileName;
-    this->fileName = NULL;
-  }
 }
 
@@ -56,5 +50,5 @@
  * @return true if the item exists
  */
-bool Preferences::exists(const char* section, const char* name)
+bool Preferences::exists( const std::string& section, const std::string& name)
 {
   std::list<prefSection>::const_iterator it = data.begin();
@@ -62,5 +56,5 @@
   for ( ; it!=data.end(); it++)
   {
-    if ( strcmp(it->sectionName, section) == 0 )
+    if ( it->sectionName == section )
     {
       std::list<prefItem>::const_iterator it2 = it->items.begin();
@@ -68,5 +62,5 @@
       for ( ; it2!=it->items.end(); it2++)
       {
-        if ( strcmp(it2->name, name) == 0 )
+        if ( it2->name == name )
           return true;
       }
@@ -85,5 +79,5 @@
  * @param value value
  */
-void Preferences::setString(const char* section, const char* name, const char* value, bool dontSetModified)
+void Preferences::setString(const std::string& section, const std::string& name, const std::string& value, bool dontSetModified)
 {
   MultiType t(value);
@@ -97,5 +91,5 @@
  * @param value value
  */
-void Preferences::setInt(const char* section, const char* name, int value, bool dontSetModified)
+void Preferences::setInt(const std::string& section, const std::string& name, int value, bool dontSetModified)
 {
   MultiType t(value);
@@ -109,5 +103,5 @@
  * @param value value
  */
-void Preferences::setFloat(const char* section, const char* name, float value, bool dontSetModified)
+void Preferences::setFloat(const std::string& section, const std::string& name, float value, bool dontSetModified)
 {
   MultiType t(value);
@@ -122,5 +116,5 @@
  * @return value of the item if found. defaultValue else
  */
-const char* Preferences::getString(const char* section, const char* name, const char* defaultValue)
+const std::string Preferences::getString(const std::string& section, const std::string& name, const std::string& defaultValue)
 {
   return getMultiType(section, name, MultiType(defaultValue)).getString();
@@ -134,5 +128,5 @@
  * @return value of the item if found. defaultValue else
  */
-int Preferences::getInt(const char* section, const char* name, int defaultValue)
+int Preferences::getInt(const std::string& section, const std::string& name, int defaultValue)
 {
   return getMultiType(section, name, MultiType(defaultValue)).getInt();
@@ -146,5 +140,5 @@
  * @return value of the item if found. defaultValue else
  */
-float Preferences::getFloat(const char* section, const char* name, float defaultValue)
+float Preferences::getFloat(const std::string& section, const std::string& name, float defaultValue)
 {
   return getMultiType(section, name, MultiType(defaultValue)).getFloat();
@@ -157,5 +151,5 @@
  * @param value value
  */
-void Preferences::setMultiType(const char* section, const char* name, const MultiType& value, bool dontSetModified)
+void Preferences::setMultiType(const std::string& section, const std::string& name, const MultiType& value, bool dontSetModified)
 {
   std::list<prefSection>::iterator it = data.begin();
@@ -163,5 +157,5 @@
   for ( ; it!=data.end(); it++)
   {
-    if ( strcmp(it->sectionName, section) == 0 )
+    if ( it->sectionName == section )
     {
       std::list<prefItem>::iterator it2 = it->items.begin();
@@ -169,8 +163,8 @@
       for ( ; it2!=it->items.end(); it2++)
       {
-        if ( strcmp(it2->name, name) == 0 )
+        if ( it2->name == name )
         {
           if (!dontSetModified)
-            it2->modified = strcmp(value.getString(), it2->value.getString())!=0;
+            it2->modified = value.getString() != it2->value.getString();
 
           it2->value = value;
@@ -182,6 +176,5 @@
       item.value = value;
       item.modified = !dontSetModified;
-      item.name = new char[strlen(name)+1];
-      strcpy( item.name, name );
+      item.name = name;
       it->items.push_back(item);
       return;
@@ -192,11 +185,9 @@
   item.value = value;
   item.modified = !dontSetModified;
-  item.name = new char[strlen(name)+1];
-  strcpy( item.name, name );
+  item.name = name;
 
   prefSection sec;
   sec.items.push_back(item);
-  sec.sectionName = new char[strlen(section)+1];
-  strcpy( sec.sectionName, section );
+  sec.sectionName = section;
   data.push_back( sec );
 }
@@ -209,5 +200,5 @@
  * @return value of the item if found. defaultValue else
  */
-MultiType Preferences::getMultiType(const char* section, const char* name,const MultiType& defaultValue)
+MultiType Preferences::getMultiType(const std::string& section, const std::string& name,const MultiType& defaultValue)
 {
   std::list<prefSection>::const_iterator it = data.begin();
@@ -215,5 +206,5 @@
   for ( ; it!=data.end(); it++)
   {
-    if ( strcmp(it->sectionName, section) == 0 )
+    if ( it->sectionName == section )
     {
       std::list<prefItem>::const_iterator it2 = it->items.begin();
@@ -221,5 +212,5 @@
       for ( ; it2!=it->items.end(); it2++)
       {
-        if ( strcmp(it2->name, name) == 0 )
+        if ( it2->name == name )
         {
           return it2->value;
@@ -234,18 +225,12 @@
 }
 
-void Preferences::setUserIni(const char* fileName)
-{
-  if ( this->fileName != NULL )
-  {
-    delete this->fileName;
-  }
-
-  this->fileName = new char[strlen(fileName)+1];
-  strcpy(this->fileName, fileName);
+void Preferences::setUserIni(const std::string& fileName)
+{
+  this->fileName = fileName;
 }
 
 bool Preferences::save()
 {
-  if ( this->fileName == NULL )
+  if ( this->fileName == "" )
   {
     PRINTF(1)("You must call setUserIni before you can call save()\n");
@@ -290,13 +275,13 @@
   for ( ; it!=data.end(); it++)
   {
-    PRINTF(0)("%s\n", it->sectionName);
+    PRINTF(0)("%s\n", it->sectionName.c_str());
     std::list<prefItem>::iterator it2 = it->items.begin();
 
     for ( ; it2!=it->items.end(); it2++)
     {
-      PRINTF(0)("--> %s = '%s'%s\n", it2->name, it2->value.getString(), ((!it2->modified)?"":" <modified>"));
-    }
-  }
-}
-
-
+      PRINTF(0)("--> %s = '%s'%s\n", it2->name.c_str(), it2->value.getString().c_str(), ((!it2->modified)?"":" <modified>"));
+    }
+  }
+}
+
+
Index: branches/preferences/src/lib/util/preferences.h
===================================================================
--- branches/preferences/src/lib/util/preferences.h	(revision 7243)
+++ branches/preferences/src/lib/util/preferences.h	(revision 7244)
@@ -64,5 +64,5 @@
    std::list<IniFilePrefsReader*> iniFilePrefsReaders;
 
-   std::string& fileName;
+   std::string fileName;
 
 };
