svnno****@sourc*****
svnno****@sourc*****
2009年 7月 19日 (日) 10:00:21 JST
Revision: 2441 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2441 Author: nogu Date: 2009-07-19 10:00:21 +0900 (Sun, 19 Jul 2009) Log Message: ----------- remove an item from a TODO list Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-18 23:52:19 UTC (rev 2440) +++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp 2009-07-19 01:00:21 UTC (rev 2441) @@ -26,7 +26,7 @@ using namespace Kita; -#define DMANAGER_MAXQUEUE 16 +static const int DMANAGER_MAXQUEUE = 16; DatInfoList DatManager::m_datInfoList; @@ -135,16 +135,14 @@ /* delete the all old instances (LRU algorithm)*/ if (m_datInfoList.count() > DMANAGER_MAXQUEUE) { - - DatInfoList::Iterator it; - // TODO -#if 0 - for (it = m_datInfoList.at(DMANAGER_MAXQUEUE); it != m_datInfoList.end(); ++it) { - - if ((*it) == 0) continue; - DatInfo* deleteInfo = (*it); + for (int i = DMANAGER_MAXQUEUE; i < m_datInfoList.count(); i++) { + DatInfo* deleteInfo = m_datInfoList.at(i); + if (deleteInfo == 0) + continue; + m_datInfoList.removeAt(i); + i--; + delete datInfo; } -#endif } return datInfo;