summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/config.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/library/config.cpp b/library/config.cpp
index e9cae4c..72bd4d2 100644
--- a/library/config.cpp
+++ b/library/config.cpp
@@ -138,25 +138,24 @@ void ConfigCache::remove( const QString& fileName ) {
138} 138}
139 139
140void ConfigCache::removeLru() { 140void ConfigCache::removeLru() {
141 QMap<QString, ConfigData>::Iterator it = m_cached.begin(); 141 QMap<QString, ConfigData>::Iterator it = m_cached.begin();
142 QMap<QString, ConfigData>::Iterator lru = it; 142 QMap<QString, ConfigData>::Iterator lru = it;
143 ++it; 143 ++it;
144 for (; it != m_cached.end(); ++it) 144 for (; it != m_cached.end(); ++it)
145 if ((*it).used.tv_sec < (*lru).used.tv_sec || 145 if ((*it).used.tv_sec < (*lru).used.tv_sec ||
146 ((*it).used.tv_sec == (*lru).used.tv_sec && 146 ((*it).used.tv_sec == (*lru).used.tv_sec &&
147 (*it).used.tv_usec < (*lru).used.tv_usec)) 147 (*it).used.tv_usec < (*lru).used.tv_usec))
148 lru = it; 148 lru = it;
149 149
150 qWarning( "Removing item" );
151 m_totalSize -= (*lru).size; 150 m_totalSize -= (*lru).size;
152 m_cached.remove(lru); 151 m_cached.remove(lru);
153} 152}
154 153
155void ConfigCache::timerEvent( QTimerEvent* ) { 154void ConfigCache::timerEvent( QTimerEvent* ) {
156 while ( m_totalSize > CONFIG_CACHE_SIZE ) 155 while ( m_totalSize > CONFIG_CACHE_SIZE )
157 removeLru(); 156 removeLru();
158 157
159 killTimer(m_tid); 158 killTimer(m_tid);
160 m_tid = 0; 159 m_tid = 0;
161} 160}
162 161