Index: /branches/qt_gui/config.h.in
===================================================================
--- /branches/qt_gui/config.h.in	(revision 7623)
+++ /branches/qt_gui/config.h.in	(revision 7624)
@@ -1,6 +1,3 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to the read-only architecture-independent data directory. */
-#undef DATADIR
 
 /* in which debug mode we are */
@@ -95,4 +92,8 @@
 #undef MODULAR_DEBUG
 
+/* Define to the read-only architecture-independent data directory of ORXONOX.
+   */
+#undef ORX_DATADIR
+
 /* Name of package */
 #undef PACKAGE
Index: /branches/qt_gui/configure.ac
===================================================================
--- /branches/qt_gui/configure.ac	(revision 7623)
+++ /branches/qt_gui/configure.ac	(revision 7624)
@@ -38,5 +38,5 @@
 AM_INIT_AUTOMAKE
 
-AC_CONFIG_SRCDIR([./src])
+AC_CONFIG_SRCDIR([src/orxonox.cc])
 AC_CONFIG_HEADER([config.h])
 
@@ -64,7 +64,7 @@
         echo "given: $DATA_DIR"
 fi
-AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"],
+AC_DEFINE_UNQUOTED([ORX_DATADIR], ["$DATA_DIR"],
                    [Define to the read-only architecture-independent
-                    data directory.])
+                    data directory of ORXONOX.])
 
 #-----------------#
Index: /branches/qt_gui/src/defs/globals.h
===================================================================
--- /branches/qt_gui/src/defs/globals.h	(revision 7623)
+++ /branches/qt_gui/src/defs/globals.h	(revision 7624)
@@ -25,5 +25,5 @@
 #define   DEFAULT_CONFIG_FILE              "~/.orxonox/orxonox.conf"
 #define   DEFAULT_LOCK_FILE                "~/.orxonox/orxonox.lock"
-#define   DEFAULT_DATA_DIR                 DATADIR "/orxonox/"
+#define   DEFAULT_DATA_DIR                 ORX_DATADIR "/orxonox/"
 #define   DEFAULT_DATA_DIR_CHECKFILE       "data.oxd"
 
Index: /branches/qt_gui/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- /branches/qt_gui/src/lib/parser/ini_parser/ini_parser.h	(revision 7623)
+++ /branches/qt_gui/src/lib/parser/ini_parser/ini_parser.h	(revision 7624)
@@ -10,10 +10,7 @@
 
 #define PARSELINELENGHT     512       //!< how many chars to read at once
-#ifndef NULL
- #define NULL 0x0                     //!< NULL
-#endif
 
+#include "src/lib/util/file.h"
 #include <list>
-#include <string>
 
 //! ini-file parser
Index: /branches/qt_gui/src/lib/util/directory.cc
===================================================================
--- /branches/qt_gui/src/lib/util/directory.cc	(revision 7623)
+++ /branches/qt_gui/src/lib/util/directory.cc	(revision 7624)
@@ -36,4 +36,9 @@
 
 #include "directory.h"
+
+#if not defined (__WIN32__)
+ #include <sys/stat.h>
+ #include <sys/types.h>
+#endif
 Directory::Directory(const std::string& directoryName)
     : willfail(false)
@@ -41,15 +46,13 @@
   this->handle = 0;
   this->willfail = true;
-  this->open(directoryName);
 }
 
 Directory::~Directory()
 {
-  this->close();
 }
 
 bool Directory::open(const std::string& directoryName)
 {
-#if defined(OSLINK_OSDIR_POSIX)
+#if not defined(__WIN32__)
   if (this->handle != NULL)
     this->close();
@@ -66,5 +69,5 @@
       willfail = true;
   }
-#elif defined(OSLINK_OSDIR_WINDOWS)
+#else
     if (handle != INVALID_HANDLE_VALUE)
       this->close();
@@ -99,11 +102,11 @@
 }
 
-void Directory::close()
+bool Directory::close()
 {
-#if defined(OSLINK_OSDIR_POSIX)
+#if not defined(__WIN32__)
   if (this->handle != NULL)
     closedir(handle);
   this->handle = NULL;
-#elif defined(OSLINK_OSDIR_WINDOWS)
+#else
   if (handle != INVALID_HANDLE_VALUE)
     FindClose(handle);
@@ -112,4 +115,5 @@
   this->willfail = true;
   this->current = "";
+  return true;
 }
 
@@ -118,5 +122,5 @@
 std::string Directory::next()
 {
-#if defined(OSLINK_OSDIR_POSIX)
+#if not defined(__WIN32__)
   std::string prev(current);
   dirent* entry = readdir(handle);
@@ -127,5 +131,5 @@
   return prev;
 
-#elif defined(OSLINK_OSDIR_WINDOWS)
+#else
   std::string prev = current;
   WIN32_FIND_DATA entry;
@@ -138,2 +142,12 @@
 #endif
 }
+
+
+bool Directory::create()
+{
+#if not defined (__WIN32__)
+  return (!mkdir(this->name().c_str(), 0777));
+#else
+  return (!CreateDirectory(this->name().c_str(), NULL));
+#endif
+}
Index: /branches/qt_gui/src/lib/util/directory.h
===================================================================
--- /branches/qt_gui/src/lib/util/directory.h	(revision 7623)
+++ /branches/qt_gui/src/lib/util/directory.h	(revision 7624)
@@ -1,2 +1,8 @@
+/*!
+ * @file directory.h
+ * @brief Definition of the Directory Handler class
+ */
+
+
 /**
  * Copyright (C) 2002 Bart Vanhauwaert
@@ -20,34 +26,15 @@
 #define __DIRECTORY_H_
 
-#if defined(unix) || defined(__unix) || defined(__unix__)
-#define OSLINK_OSDIR_POSIX
-#elif defined(_WIN32)
-#define OSLINK_OSDIR_WINDOWS
+#include "file.h"
+
+#if not defined (__WIN32__)
+ #include <sys/types.h>
+ #include <dirent.h>
 #else
-#define OSLINK_OSDIR_NOTSUPPORTED
+ #include <windows.h>
+ #include <winbase.h>
 #endif
 
-#include <string>
-
-#if defined(OSLINK_OSDIR_NOTSUPPORTED)
-#warning DIRECTORY NOT SUPPORTET
-
-#elif defined(OSLINK_OSDIR_POSIX)
-#include <sys/types.h>
-#include <dirent.h>
-
-#elif defined(OSLINK_OSDIR_WINDOWS)
-
-/// HACK
-#ifdef DATADIR
-#undef DATADIR
-#endif
-
-#include <windows.h>
-#include <winbase.h>
-
-#endif
-
-class Directory
+class Directory : public File
 {
 public:
@@ -55,15 +42,17 @@
   ~Directory();
 
-  bool open(const std::string& directoryName);
-  void close();
+  virtual bool open(const std::string& directoryName);
+  virtual bool close();
   operator void*() const { return willfail ? (void*)0:(void*)(-1); }
 
   std::string next();
 
+  bool create();
+
 private:
-#if defined(OSLINK_OSDIR_POSIX)
+#if not defined(__WIN32__)
   DIR* handle;
-#elif defined(OSLINK_OSDIR_WINDOWS)
-    HANDLE    handle;
+#else
+  HANDLE    handle;
 #endif
   bool willfail;
Index: /branches/qt_gui/src/lib/util/file.cc
===================================================================
--- /branches/qt_gui/src/lib/util/file.cc	(revision 7623)
+++ /branches/qt_gui/src/lib/util/file.cc	(revision 7624)
@@ -263,13 +263,14 @@
  *
  * if the File was opened, it will be closed throuh this function.
+ * The File will also be closed, if the File was not renamed.
  */
 bool File::rename(const File& destination)
 {
+  this->close();
+
   if (!std::rename(this->_name.c_str(), destination.name().c_str()))
   {
-    this->close();
     this->_name = destination.name();
     this->statFile();
-
     return true;
   }
@@ -292,4 +293,6 @@
   }
   fclose(stream);
+
+  this->statFile();
   return true;
 }
