Index: trunk/src/lib/util/ini_parser.cc
===================================================================
--- trunk/src/lib/util/ini_parser.cc	(revision 5110)
+++ trunk/src/lib/util/ini_parser.cc	(revision 5111)
@@ -58,9 +58,9 @@
   {
     tIterator<IniSection>* sectionIt = this->sections->getIterator();
-    IniSection* sectionEnum = sectionIt->firstElement();
+    IniSection* sectionEnum = sectionIt->nextElement();
     while (sectionEnum)
     {
       tIterator<IniEntry>* entryIt = sectionEnum->entries->getIterator();
-      IniEntry* entryEnum = entryIt->firstElement();
+      IniEntry* entryEnum = entryIt->nextElement();
       while (entryEnum)
       {
@@ -192,5 +192,5 @@
     {
       tIterator<IniSection>* sectionIt = this->sections->getIterator();
-      IniSection* sectionEnum = sectionIt->firstElement();
+      IniSection* sectionEnum = sectionIt->nextElement();
       while (sectionEnum)
       {
@@ -198,5 +198,5 @@
 
         tIterator<IniEntry>* entryIt = sectionEnum->entries->getIterator();
-        IniEntry* entryEnum = entryIt->firstElement();
+        IniEntry* entryEnum = entryIt->nextElement();
         while (entryEnum)
         {
@@ -246,5 +246,5 @@
 {
   tIterator<IniSection>* sectionIt = this->sections->getIterator();
-  IniSection* sectionEnum = sectionIt->firstElement();
+  IniSection* sectionEnum = sectionIt->nextElement();
   while (sectionEnum)
   {
@@ -347,5 +347,5 @@
   {
     tIterator<IniSection>* sectionIt = this->sections->getIterator();
-    IniSection* sectionEnum = sectionIt->firstElement();
+    IniSection* sectionEnum = sectionIt->nextElement();
     while (sectionEnum)
     {
@@ -395,5 +395,5 @@
   {
     tIterator<IniSection>* sectionIt = this->sections->getIterator();
-    IniSection* sectionEnum = sectionIt->firstElement();
+    IniSection* sectionEnum = sectionIt->nextElement();
     while (sectionEnum)
     {
@@ -401,5 +401,5 @@
       {
         tIterator<IniEntry>* entryIt = sectionEnum->entries->getIterator();
-        IniEntry* entryEnum = entryIt->firstElement();
+        IniEntry* entryEnum = entryIt->nextElement();
         while (entryEnum)
         {
@@ -452,5 +452,5 @@
   {
     tIterator<IniSection>* sectionIt = this->sections->getIterator();
-    IniSection* sectionEnum = sectionIt->firstElement();
+    IniSection* sectionEnum = sectionIt->nextElement();
     while (sectionEnum)
     {
@@ -458,5 +458,5 @@
 
       tIterator<IniEntry>* entryIt = sectionEnum->entries->getIterator();
-      IniEntry* entryEnum = entryIt->firstElement();
+      IniEntry* entryEnum = entryIt->nextElement();
       while (entryEnum)
       {
Index: trunk/src/lib/util/list.h
===================================================================
--- trunk/src/lib/util/list.h	(revision 5110)
+++ trunk/src/lib/util/list.h	(revision 5111)
@@ -12,5 +12,5 @@
 #endif
 
-template<class T> class tIterator;
+
 
 //! a list element of the tList,
@@ -23,4 +23,101 @@
 
 /**
+ *  an iterator class
+
+   this enables the user to iterate through a list very easely
+*/
+template<class T> class tIterator
+{
+ public:
+  tIterator(listElement<T>* startElement);
+  ~tIterator();
+
+  T* nextElement();
+  T* seekElement(T* element);
+
+ private:
+  listElement<T>*    currentEl;                      //!< pointer to the current list element in the iterator
+  listElement<T>*    tmpEl;                          //!< temp listElemnt pointer
+  listElement<T>*    startElement;                   //!< pointer to the start of the list
+};
+
+
+/**
+ *  iterator constructor
+ * @param startElement:  the first list element from the tList
+
+   normaly you will use it like this:
+
+   tIterator<char>* nameIterator = nameList->getIterator();
+   char name* = nameIterator->nextElement();
+   while( name != NULL)
+   {
+     PRINTF(3)("found name: %s in list\n", name);
+     name = nameIterator->nextElement();
+   }
+   delete nameIterator;
+*/
+template<class T>
+inline tIterator<T>::tIterator (listElement<T>* startElement)
+{
+  this->currentEl = startElement;
+  this->tmpEl = NULL;
+  this->startElement = startElement;
+}
+
+
+/**
+ *  the destructor
+*/
+template<class T>
+inline tIterator<T>::~tIterator ()
+{
+  this->currentEl = NULL;
+}
+
+
+/**
+ *  use it to iterate through the list
+ * @returns next list element
+*/
+template<class T>
+inline T* tIterator<T>::nextElement ()
+{
+  if( this->currentEl == NULL)
+    return NULL;
+
+  this->tmpEl = this->currentEl;
+  this->currentEl = this->currentEl->next;
+  return this->tmpEl->curr;
+}
+
+/**
+ *  gets the element after the selected one, sets the iterator to this point in the list
+ * @param element the element to seek
+ * @returns next list element
+
+  Attention: if you seek an element, the iterator pointer will point to the NEXT listelement after the argument!
+ */
+template<class T>
+inline T* tIterator<T>::seekElement (T* element)
+{
+  for(this->tmpEl = this->startElement; this->tmpEl != NULL; this->tmpEl = this->tmpEl->next)
+  {
+    if( unlikely(this->tmpEl->curr == element))
+    {
+      if( this->tmpEl->next != NULL)
+      {
+        this->currentEl = this->tmpEl->next->next;
+        return this->tmpEl->next->curr;
+      }
+      return NULL;
+    }
+  }
+  return NULL;
+}
+
+
+
+/**
  *  the list template class
 
@@ -29,6 +126,4 @@
 template<class T> class tList
 {
-  friend class tIterator<T>;
-
  public:
   tList ();
@@ -40,10 +135,10 @@
   void removeLast();
   void flush();
-  T* firstElement() const;
-  T* lastElement() const;
-  bool isEmpty() const;
-  unsigned int getSize() const;
+  T* firstElement();
+  T* lastElement();
+  bool isEmpty();
+  unsigned int getSize();
   bool inList(T* entity);
-  tIterator<T>* getIterator() const;
+  tIterator<T>* getIterator();
   T* nextElement(T* toEntity);
   T* toArray();
@@ -208,5 +303,5 @@
 */
 template<class T>
-inline T* tList<T>::firstElement() const
+inline T* tList<T>::firstElement()
 {
   return this->first->curr;
@@ -219,5 +314,5 @@
 */
 template<class T>
-inline T* tList<T>::lastElement() const
+inline T* tList<T>::lastElement()
 {
   return this->last->curr;
@@ -230,5 +325,5 @@
 */
 template<class T>
-inline bool tList<T>::isEmpty() const
+inline bool tList<T>::isEmpty()
 {
   return (this->size==0)?true:false;
@@ -264,5 +359,5 @@
 */
 template<class T>
-inline unsigned int tList<T>::getSize() const
+inline unsigned int tList<T>::getSize()
 {
   return this->size;
@@ -277,7 +372,8 @@
 */
 template<class T>
-inline tIterator<T>* tList<T>::getIterator() const
-{
-  return new tIterator<T>(this);
+inline tIterator<T>* tList<T>::getIterator()
+{
+  tIterator<T>* iterator = new tIterator<T>(this->first);
+  return iterator;
 }
 
@@ -318,114 +414,3 @@
 }
 
-
-
-
-/**
- *  an iterator class
-
-   this enables the user to iterate through a list very easely
- */
-template<class T> class tIterator
-{
-  public:
-    tIterator(const tList<T>* list);
-    ~tIterator();
-
-    T* firstElement();
-    T* nextElement();
-    T* seekElement(T* element);
-
-  private:
-    listElement<T>*    currentEl;                      //!< pointer to the current list element in the iterator
-    listElement<T>*    tmpEl;                          //!< temp listElemnt pointer
-    const tList<T>*    list;                           //!< The List, that we want to iterate through
-};
-
-
-/**
- *  iterator constructor
- * @param startElement:  the first list element from the tList
-
-   normaly you will use it like this:
-
-   tIterator<char>* nameIterator = nameList->getIterator();
-                char name* = nameIterator->nextElement();
-                while( name != NULL)
-{
-                PRINTF(3)("found name: %s in list\n", name);
-                name = nameIterator->nextElement();
-}
-                delete nameIterator;
- */
-                template<class T>
-                inline tIterator<T>::tIterator (const tList<T>* list)
-{
-  this->currentEl = list->first;
-  this->tmpEl = NULL;
-  this->list = list;
-}
-
-
-/**
- *  the destructor
- */
-template<class T>
-    inline tIterator<T>::~tIterator ()
-{
-  this->currentEl = NULL;
-}
-
-template<class T>
-    inline T* tIterator<T>::firstElement ()
-{
-  this->currentEl = this->list->first;
-  if (this->currentEl == NULL)
-    return NULL;
-  else
-    return this->currentEl->curr;
-}
-
-
-/**
- *  use it to iterate through the list
- * @returns next list element
- */
-template<class T>
-    inline T* tIterator<T>::nextElement ()
-{
-  if( this->currentEl == NULL || this->currentEl->next == NULL)
-  {
-    this->currentEl = NULL;
-    return NULL;
-  }
-
-  this->currentEl = this->currentEl->next;
-  return this->currentEl->curr;
-}
-
-/**
- *  gets the element after the selected one, sets the iterator to this point in the list
- * @param element the element to seek
- * @returns next list element
-
-  Attention: if you seek an element, the iterator pointer will point to the NEXT listelement after the argument!
- */
-template<class T>
-    inline T* tIterator<T>::seekElement (T* element)
-{
-  for(this->tmpEl = this->list->first; this->tmpEl != NULL; this->tmpEl = this->tmpEl->next)
-  {
-    if( unlikely(this->tmpEl->curr == element))
-    {
-      if( this->tmpEl->next != NULL)
-      {
-        this->currentEl = this->tmpEl;
-        return this->tmpEl->next->curr;
-      }
-      return NULL;
-    }
-  }
-  return NULL;
-}
-
 #endif /* _LIST_H */
