Index: branches/qt_gui/src/lib/util/file.cc
===================================================================
--- branches/qt_gui/src/lib/util/file.cc	(revision 7620)
+++ branches/qt_gui/src/lib/util/file.cc	(revision 7621)
@@ -33,24 +33,29 @@
 #include <cassert>
 
+File::File()
+{
+  this->init();
+}
 
 File::File(const std::string& fileName)
 {
-  this->_name = fileName;
-  File::homeDirCheck(this->_name);
   this->init();
+  this->setFileName(fileName);
 }
 
 File::File(const File& file)
 {
-  this->_name = file._name;
+  this->init();
+  this->setFileName(file.name());
 }
 
 File::~File()
 {
+  this->close();
+
   if (this->_status)
     delete this->_status;
-  if (this->_handle)
-    assert(0);
-}
+}
+
 
 /**
@@ -62,6 +67,25 @@
 {
   this->_handle = 0;
-
-  this->_status = new struct stat;
+  this->_status = NULL;
+}
+
+
+/**
+ * @brief sets a new File to apply to this File.
+ * @param fileName the Filename of the File to access.
+ */
+void File::setFileName(const std::string& fileName)
+{
+  this->close();
+  this->_name = fileName;
+  File::homeDirCheck(this->_name);
+  this->statFile();
+}
+
+
+void File::statFile()
+{
+  if (this->_status == NULL)
+    this->_status = new struct stat;
   // Check the End of the FileName and chop away any \ and //
   /*  std::string name = this->_name;
@@ -69,5 +93,4 @@
         this->_name[this->_name.size()-1] == '\\')
          name.resize(name.size()-1);*/
-
   if (stat(this->_name.c_str(), this->_status))
   {
@@ -87,9 +110,4 @@
 }
 
-int File::handle()
-{
-  return this->_handle;
-}
-
 bool File::exists() const
 {
@@ -97,4 +115,8 @@
 }
 
+/**
+ * @brief checks if the file is a Link (symlink/hardlink on UNIX)
+ * @returns true if the File is a Link, false otherwise (on windows always false)
+ */
 bool File::isLink() const
 {
@@ -105,6 +127,9 @@
 #endif
 }
-// only on UNIX
-
+
+/**
+ * @brief checks if the File is a regular File
+ * @returns true if the File is a Regular file.
+ */
 bool File::isFile() const
 {
@@ -113,6 +138,5 @@
 
 /**
- * @brief Checks if it is a Directory
- * @param directoryName the Directory to check for
+ * @brief Checks if the File is a Directory
  * @returns true if it is a directory/symlink false otherwise
  */
@@ -138,5 +162,4 @@
 #endif
 }
-
 bool File::isWriteable() const
 {
@@ -156,5 +179,9 @@
 }
 
-
+/**
+ * @brief copies the File to another File.
+ * @param destination the Destination File.
+ * @returns true on success, false otherwise.
+ */
 bool File::copy(const File& destination)
 {
@@ -168,4 +195,11 @@
 }
 
+/**
+ * @brief renames the File (move)
+ * @param destination the Destination to move this file to.
+ * @returns true on success, false otherwise.
+ *
+ * if the File was opened, it will be closed throuh this function.
+ */
 bool File::rename(const File& destination)
 {
@@ -173,8 +207,6 @@
   {
     this->close();
-    delete this->_status;
-    this->_status = NULL;
     this->_name = destination.name();
-    this->init();
+    this->statFile();
 
     return true;
@@ -183,4 +215,10 @@
 }
 
+/**
+ * @brief touches the File.
+ * @returns true if the file could have been touched. false otherwise.
+ *
+ * Touching a File means creating it.
+ */
 bool File::touch()
 {
@@ -195,4 +233,8 @@
 }
 
+/**
+ * @brief delete the File on the Disk
+ * @returns true on success, false otherwise.
+ */
 bool File::remove()
 {
@@ -203,23 +245,25 @@
 }
 
-void File::relToAbs(std::string& fileName)
-{
-  if (fileName.empty())
+/**
+ * @brief transforms a Relative path to an absolute one.
+ * @param fileName the Absolute Path.
+ */
+void File::relToAbs(std::string& relFileName)
+{
+  if (relFileName.empty())
     return ;
-  if (fileName[0] !=  '/')
-  {
-    if (fileName[0] == '.' && fileName[1] != '.')
-      fileName.erase(0);
-    fileName = File::cwd() + fileName;
-  }
-}
-
-void File::absToRel(std::string& fileName)
-{
-  if (fileName.find(cwd()) == 0)
-    fileName.replace(0, File::cwd().size(), ".");
-}
-
-
+  if (relFileName[0] !=  '/')
+  {
+    if (relFileName[0] == '.' && relFileName[1] != '.')
+      relFileName.erase(0);
+    relFileName = File::cwd() + relFileName;
+  }
+}
+
+void File::absToRel(std::string& absFileName)
+{
+  if (absFileName.find(cwd()) == 0)
+    absFileName.replace(0, File::cwd().size(), ".");
+}
 
 
@@ -243,5 +287,8 @@
 }
 
-
+/**
+ * @brief check if fileName has the '~/` prepended.
+ * @returns the fileName in absolute coordinate.
+ */
 void File::homeDirCheck(std::string& fileName)
 {
Index: branches/qt_gui/src/lib/util/file.h
===================================================================
--- branches/qt_gui/src/lib/util/file.h	(revision 7620)
+++ branches/qt_gui/src/lib/util/file.h	(revision 7621)
@@ -23,11 +23,19 @@
 
 public:
+  File();
   File(const std::string& fileName);
   File(const File& file);
   ~File();
+  void setFileName(const std::string& fileName);
+  File& operator=(const std::string& fileName);
+  File& operator=(const File& file);
+  bool operator==(const std::string& fileName) const;
+  bool operator==(const File& file) const;
+
+
 
   virtual bool open(OpenMode mode);
   virtual bool close();
-  int handle();
+  int handle() const { return this->_handle; };
 
   /** @returns the FileName of this File */
@@ -48,11 +56,11 @@
   bool remove();
 
-  static void relToAbs(std::string& fileName);
-  static void absToRel(std::string& fileName);
+  static void relToAbs(std::string& relFileName);
+  static void absToRel(std::string& absFileName);
   static const std::string& cwd();
 
   private:
     void init();
-    bool statFile();
+    void statFile();
     void homeDirCheck(std::string& fileName);
 
