Index: orxonox/branches/updater/src/gui/orxonox_gui.cc
===================================================================
--- orxonox/branches/updater/src/gui/orxonox_gui.cc	(revision 3468)
+++ orxonox/branches/updater/src/gui/orxonox_gui.cc	(revision 3469)
@@ -95,5 +95,5 @@
 
   // Reading Values from File
-  exec->setFilename("~/.orxonox.conf");
+  exec->setConfFile("~/.orxonox/orxonox.conf");
   exec->readFromFile(orxonoxGUI);
   // Merging changes to the Options from appended flags.
Index: orxonox/branches/updater/src/gui/orxonox_gui_exec.cc
===================================================================
--- orxonox/branches/updater/src/gui/orxonox_gui_exec.cc	(revision 3468)
+++ orxonox/branches/updater/src/gui/orxonox_gui_exec.cc	(revision 3469)
@@ -25,6 +25,11 @@
 
 #include "orxonox_gui_exec.h"
+
 #include <iostream>
 #include <string>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
 
 HashTable* orxonoxFlagHash;
@@ -90,6 +95,61 @@
 
 /**
+   \brief sets the confDir and File-name out of an input-string
+*/
+void OrxonoxGuiExec::setConfFile(char* confFile)
+{
+  char splitter = 
+#ifdef __WIN32__ 
+    '\\';
+#else
+  '/';
+#endif
+  char* tmpConfFile = new char[strlen(confFile)+1];
+  strcpy(tmpConfFile, confFile);
+  char* tmp = strrchr(tmpConfFile, splitter);
+  if (tmp)
+    {
+      tmp[0] = '\0';
+      this->setConfDir(tmpConfFile);
+      this->setFileName(tmp+1);
+    }
+  else
+    {
+      this->setConfDir("~/");
+      this->setFileName(tmpConfFile);
+    }
+  delete []tmp;
+  delete []tmpConfFile;
+}
+
+/**
+   \brief sets the Directory of the configuration files
+   \param confDir the Directory for the configuration files
+*/
+void OrxonoxGuiExec::setConfDir(char* confDir)
+{
+  if (!strncmp(confDir, "~/", 2))
+    {
+      char tmp[500];
+#ifdef __WIN32__
+      strcpy(tmp, getenv("USERPROFILE"));
+#else
+      strcpy(tmp, getenv("HOME"));
+#endif
+      this->confDir = new char[strlen(tmp)+strlen(confDir)];
+      sprintf(this->confDir, "%s%s", tmp, confDir+1);
+    }
+  else
+    {
+      this->confDir = new char[strlen(confDir)+1];
+      strcpy(this->confDir, confDir);
+    }
+  PRINTF(3)("Config Directory is: %s.\n", this->confDir);
+  mkdir(this->confDir, 0755);
+}
+
+/**
    \brief Sets the location of the configuration File.
-   \param filename the location of the configFile
+   \param fileName the location of the configFile
 
    \todo: memory allocation could be better.
@@ -97,19 +157,11 @@
    The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows
 */
-void OrxonoxGuiExec::setFilename(char* filename)
-{
-  char* buffer = (char*)malloc(2048*sizeof(char));
-  sprintf(buffer, "%s", filename);
-  if(!strncmp(buffer, "~/", 2))
-  {
-#ifdef __WIN32__
-    sprintf(configFile, "%s/%s", getenv("USERPROFILE"), buffer+2);
-#else
-    sprintf(configFile, "%s/%s", getenv("HOME"), buffer+2);
-#endif
-  }
-  else if(buffer)
-    strcpy(this->configFile, buffer);
-  free (buffer);
+void OrxonoxGuiExec::setFileName(char* fileName)
+{
+  if (!this->confDir)
+    this->setConfDir("~/");
+  this->configFile = new char[strlen(this->confDir)+strlen(fileName)+2];
+  sprintf(this->configFile, "%s/%s", this->confDir, fileName);
+  PRINTF(3)("ConfigurationFile is %s.\n", this->configFile);
 }
 
@@ -117,5 +169,5 @@
    \returns The name of the Configuration-File
 */
-char* OrxonoxGuiExec::getConfigFile(void)
+char* OrxonoxGuiExec::getConfigFile(void) const
 {
   return this->configFile;
Index: orxonox/branches/updater/src/gui/orxonox_gui_exec.h
===================================================================
--- orxonox/branches/updater/src/gui/orxonox_gui_exec.h	(revision 3468)
+++ orxonox/branches/updater/src/gui/orxonox_gui_exec.h	(revision 3469)
@@ -22,4 +22,5 @@
   CheckButton* alwaysShow;     //!< A CheckButton, for if orxonox should start with or without gui.
   Button* quit;                //!< A Button to quit the Gui without starting orxonox.
+  char* confDir;               //!< The directory of the orxonox-configuration-files.
   char* configFile;            //!< The name of the .orxonox.conf(ig)-file.
   FILE* CONFIG_FILE;           //!< Filehandler for reading and writing.
@@ -37,7 +38,9 @@
   
   Widget* getWidget(void);
-  
-  void setFilename(char* filename);
-  char* getConfigFile(void);
+
+  void setConfFile(char* confFile);
+  void setConfDir(char* confDir);
+  void setFileName(char* fileName);
+  char* getConfigFile(void) const;
   int shouldsave(void);
   void writeToFile(Widget* widget);
