Index: branches/preferences/src/lib/parser/ini_parser/ini_parser.cc
===================================================================
--- branches/preferences/src/lib/parser/ini_parser/ini_parser.cc	(revision 6385)
+++ branches/preferences/src/lib/parser/ini_parser/ini_parser.cc	(revision 6388)
@@ -431,4 +431,79 @@
 }
 
+/**
+ * @brief edits the entry speciefied by entryName in sectionName/currentSection or creates it if it doesn't exist
+ * @param entryName the Name of the Entry to add
+ * @param value the value to assign to this entry
+ * @param sectionName if NULL then this entry will be set to the currentSection
+ * otherwise to the section refered to by sectionName.
+ * If both are NULL no entry will be added
+ * @return true if everything is ok false on error
+ */
+bool IniParser::editVar(const char* entryName, const char* value, const char* sectionName)
+{
+  std::list<IniSection>::iterator section;
+
+  if (sectionName != NULL)
+  {
+    for (section = this->sections.begin(); section != this->sections.end(); section++)
+      if (!strcmp((*section).name, sectionName))
+        break;
+  }
+  else
+    section = this->currentSection;
+
+  if (section == this->sections.end())
+  {
+    assert( sectionName != NULL );
+
+    IniSection sec;
+    sec.comment = NULL;
+    sec.name = new char[strlen(sectionName)+1];
+    strcpy(sec.name, sectionName);
+    section = this->sections.insert(this->sections.end(), sec);
+  }
+
+  if (section == this->sections.end())
+  {
+    PRINTF(2)("section '%s' not found for value '%s'\n", sectionName, entryName);
+    return false;
+  }
+  else
+  {
+    //try find item
+    std::list<IniEntry>::iterator entry;
+    for (entry = section->entries.begin(); entry!=section->entries.end(); entry++)
+      if (!strcmp( entry->name, entryName ))
+        break;
+
+    //found it?
+    if ( entry != section->entries.end() )
+    {
+      if ( entry->value != NULL )
+      {
+        delete[] entry->value;
+      }
+      entry->value = new char[strlen(value)+1];
+      strcpy(entry->value, value);
+
+      return true;
+    }
+
+    //not found -> create it
+    (*section).entries.push_back(IniEntry());
+    (*section).entries.back().comment = NULL;
+    (*section).entries.back().name = new char[strlen(entryName)+1];
+    strcpy((*section).entries.back().name, entryName);
+    (*section).entries.back().value = new char[strlen(value)+1];
+    strcpy((*section).entries.back().value, value);
+    PRINTF(5)("Added Entry %s with Value '%s' to Section %s\n",
+    (*section).entries.back().name,
+    (*section).entries.back().value,
+    (*section).name);
+    this->currentEntry = --(*section).entries.end();
+    return true;
+  }
+}
+
 
 /**
Index: branches/preferences/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- branches/preferences/src/lib/parser/ini_parser/ini_parser.h	(revision 6385)
+++ branches/preferences/src/lib/parser/ini_parser/ini_parser.h	(revision 6388)
@@ -67,4 +67,5 @@
 
     bool addVar(const char* entryName, const char* value, const char* sectionName = NULL);
+    bool editVar(const char* entryName, const char* value, const char* sectionName = NULL);
     const char* getVar(const char* entryName, const char* sectionName, const char* defaultValue = "") const;
     void setEntryComment(const char* comment, const char* entryName, const char* sectionName);
Index: branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc
===================================================================
--- branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 6385)
+++ branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 6388)
@@ -36,9 +36,3 @@
 }
 
-/**
- * reads the commandline arguments and stores them in Preferences
- * @return true if commanline arguments have been interpreted correctly
- */
-bool CmdLinePrefsReader::readCmdLine()
-{
-}
+
Index: branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h
===================================================================
--- branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h	(revision 6385)
+++ branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h	(revision 6388)
@@ -14,6 +14,4 @@
    virtual ~CmdLinePrefsReader();
 
-   bool readCmdLine();
-
  private:
 
Index: branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc
===================================================================
--- branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc	(revision 6385)
+++ branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc	(revision 6388)
@@ -24,6 +24,31 @@
  * standard constructor
 */
-IniFilePrefsReader::IniFilePrefsReader ()
+IniFilePrefsReader::IniFilePrefsReader ( const char * fileName )
 {
+  IniParser iniParser;
+
+  if ( !iniParser.readFile( fileName ) )
+    return;
+
+  Preferences* prefs = Preferences::getInstance();
+
+  iniParser.firstSection();
+
+  do
+  {
+    do
+    {
+      prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true );
+    } while (iniParser.nextVar());
+  } while (iniParser.nextSection()!=NULL);
+
+  /*iniParser.firstVar();
+
+  Preferences* prefs = Preferences::getInstance();
+
+  while ( iniParser.nextVar() )
+  {
+    prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true );
+}*/
 }
 
@@ -36,25 +61,3 @@
 }
 
-/**
- * reads entries from inifile fileName into Preferences
- * @param fileName filename of inifile to read
- * @return true on success
- */
-bool IniFilePrefsReader::readIniFile( const char * fileName )
-{
-  IniParser iniParser;
 
-  if ( !iniParser.readFile( fileName ) )
-    return false;
-
-  iniParser.firstVar();
-
-  Preferences* prefs = Preferences::getInstance();
-
-  while ( iniParser.nextVar() )
-  {
-    prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue() );
-  }
-
-  return true;
-}
Index: branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h
===================================================================
--- branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h	(revision 6385)
+++ branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h	(revision 6388)
@@ -15,10 +15,7 @@
 
  public:
-   IniFilePrefsReader();
+   IniFilePrefsReader(const char* fileName);
    virtual ~IniFilePrefsReader();
 
-   bool readIniFile(const char* fileName);
-
- private:
 
 };
