[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenox/konq-embed/src
From:       Uli Luckas <u.luckas () road-gmbh ! de>
Date:       2007-08-08 12:51:30
Message-ID: 1186577490.200342.1835.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 697703 by luckas:

- Fix a crash during flushing old URLs from the history. A call to \
                m_content.remove(it) would leave the iterator it pointing to a \
                deleted entry.
- Fix output of wrong date in debug message


 M  +6 -3      urlcombo.cpp  


--- trunk/kdenox/konq-embed/src/urlcombo.cpp #697702:697703
@@ -372,13 +372,16 @@
          // Remove entries older than 7 Days
          QDate current_date = QDate::currentDate();
          QValueList<HistoryContent>::Iterator it;
-         for( it = m_content.begin(); it != m_content.end(); ++it )
+         it = m_content.begin();
+         while( it != m_content.end() )
          {
              kdDebug() << "Entry Date: " << (*it).date.toString() << endl;
-             kdDebug() << "Entry Until: " << current_date.addDays( \
m_maxDaysInHistory ).toString() << endl; +             kdDebug() << "Entry Until: " \
                << (*it).date.addDays( m_maxDaysInHistory ).toString() << endl;
              kdDebug() << "Entry too old: " << ((*it).date.addDays( \
                m_maxDaysInHistory ) < current_date ) << endl;
              if ( (*it).date.addDays( m_maxDaysInHistory ) < current_date )
-                 m_content.remove( it );
+                 it = m_content.remove( it );
+             else
+                 ++it;
          }
          
         // Add or remove stuff which belongs to a correct URL


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic