Index: code/branches/gamestate/src/libraries/core/ConfigFileManager.h
===================================================================
--- code/branches/gamestate/src/libraries/core/ConfigFileManager.h	(revision 6432)
+++ code/branches/gamestate/src/libraries/core/ConfigFileManager.h	(revision 6437)
@@ -39,4 +39,5 @@
 
 #include "util/Singleton.h"
+#include "util/StringUtils.h"
 
 namespace orxonox // tolua_export
@@ -191,8 +192,13 @@
             inline void setValue(const std::string& name, const std::string& value, bool bString)
                 { this->getOrCreateEntry(name, value, bString)->setValue(value); }
-            inline const std::string& getValue(const std::string& name, const std::string& fallback, bool bString) const
+            inline const std::string& getValue(const std::string& name, bool bString)
             {
                 ConfigFileEntry* entry = this->getEntry(name);
-                return (entry ? entry->getValue() : BLANKSTRING);
+                if (entry)
+                {
+                    entry->setString(bString);
+                    return entry->getValue();
+                }
+                return BLANKSTRING;
             }
             inline const std::string& getOrCreateValue(const std::string& name, const std::string& fallback, bool bString)
@@ -201,8 +207,13 @@
             inline void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)
                 { this->getOrCreateEntry(name, index, value, bString)->setValue(value); }
-            inline const std::string& getValue(const std::string& name, unsigned int index) const
+            inline const std::string& getValue(const std::string& name, unsigned int index, bool bString)
             {
                 ConfigFileEntry* entry = this->getEntry(name, index);
-                return (entry ? entry->getValue() : BLANKSTRING);
+                if (entry)
+                {
+                    entry->setString(bString);
+                    return entry->getValue();
+                }
+                return BLANKSTRING;
             }
             inline const std::string& getOrCreateValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
@@ -222,15 +233,11 @@
                 { return this->entries_.end(); }
 
-            std::list<ConfigFileEntry*>::const_iterator getEntryIterator(const std::string& name) const;
-            std::list<ConfigFileEntry*>::iterator       getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString);
-            std::list<ConfigFileEntry*>::const_iterator getEntryIterator(const std::string& name, unsigned int index) const;
-            std::list<ConfigFileEntry*>::iterator       getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString);
-
-            inline ConfigFileEntry* getEntry(const std::string& name) const
-                { return (*this->getEntryIterator(name)); }
+            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString);
+            std::list<ConfigFileEntry*>::iterator getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString);
+
+            ConfigFileEntry* getEntry(const std::string& name) const;
             inline ConfigFileEntry* getOrCreateEntry(const std::string& name, const std::string& fallback, bool bString)
                 { return (*this->getOrCreateEntryIterator(name, fallback, bString)); }
-            inline ConfigFileEntry* getEntry(const std::string& name, unsigned int index) const
-                { return (*this->getEntryIterator(name, index)); }
+            ConfigFileEntry* getEntry(const std::string& name, unsigned int index) const;
             inline ConfigFileEntry* getOrCreateEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
                 { return (*this->getOrCreateEntryIterator(name, index, fallback, bString)); }
@@ -249,5 +256,5 @@
     {
         public:
-            ConfigFile(const std::string& filename);
+            ConfigFile(const std::string& filename, bool bCopyFallbackFile = true);
             virtual ~ConfigFile();
 
@@ -265,5 +272,5 @@
                 this->save();
             }
-            inline const std::string& getValue(const std::string& section, const std::string& name, bool bString) const
+            inline const std::string& getValue(const std::string& section, const std::string& name, bool bString)
             {
                 ConfigFileSection* sectionPtr = this->getSection(section);
@@ -274,11 +281,11 @@
             inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
             {
-                this->getSection(section)->setValue(name, index, value, bString);
+                this->getOrCreateSection(section)->setValue(name, index, value, bString);
                 this->save();
             }
-            inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index) const
+            inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index, bool bString)
             {
                 ConfigFileSection* sectionPtr = this->getSection(section);
-                return (sectionPtr ? sectionPtr->getValue(name, index) : BLANKSTRING);
+                return (sectionPtr ? sectionPtr->getValue(name, index, bString) : BLANKSTRING);
             }
             const std::string& getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString);
@@ -290,4 +297,6 @@
                 return (sectionPtr ? sectionPtr->getVectorSize(name) : 0);
             }
+
+            static const char* DEFAULT_CONFIG_FOLDER;
 
         protected:
@@ -300,4 +309,5 @@
             void saveIfUpdated();
             const std::string filename_;
+            const bool bCopyFallbackFile_;
             bool bUpdated_;
     };
