예제 #1
0
void QgsSvgCache::trimToMaximumSize()
{
  QgsSvgCacheEntry* entry = mLeastRecentEntry;
  while ( entry && ( mTotalSize > mMaximumSize ) )
  {
    QgsSvgCacheEntry* bkEntry = entry;
    entry = entry->nextEntry;

    takeEntryFromList( bkEntry );
    mEntryLookup.remove( bkEntry->file, bkEntry );
    mTotalSize -= bkEntry->dataSize();
    delete bkEntry;
  }
}
예제 #2
0
void QgsSvgCache::trimToMaximumSize()
{
  //only one entry in cache
  if ( mLeastRecentEntry == mMostRecentEntry )
  {
    return;
  }
  QgsSvgCacheEntry* entry = mLeastRecentEntry;
  while ( entry && ( mTotalSize > mMaximumSize ) )
  {
    QgsSvgCacheEntry* bkEntry = entry;
    entry = entry->nextEntry;

    takeEntryFromList( bkEntry );
    mEntryLookup.remove( bkEntry->lookupKey, bkEntry );
    mTotalSize -= bkEntry->dataSize();
    delete bkEntry;
  }
}