src/hbservers/hbthemeserver/hbicondatacache_p.cpp
changeset 23 e6ad4ef83b23
parent 21 4633027730f5
child 28 b7da29130b0e
--- a/src/hbservers/hbthemeserver/hbicondatacache_p.cpp	Wed Aug 18 10:05:37 2010 +0300
+++ b/src/hbservers/hbthemeserver/hbicondatacache_p.cpp	Thu Sep 02 20:44:51 2010 +0300
@@ -189,7 +189,7 @@
     cache->clear();
     
     // close the sgimage driver after all the 
-	// sgimage items and its memory were deleted.
+    // sgimage items and its memory were deleted.
 #ifdef HB_SGIMAGE_ICON
     if (!goodMemory && (currentGpuCacheSize <= 0) ) {
         HbSgImageRenderer::global()->terminate();
@@ -726,7 +726,7 @@
             }
         }
         // close the sgimage driver after all the 
-		// sgimage items and its memory were deleted.
+        // sgimage items and its memory were deleted.
 #ifdef HB_SGIMAGE_ICON
         if (!goodMemory && (currentGpuCacheSize <= 0) ) {
             HbSgImageRenderer::global()->terminate();
@@ -841,7 +841,22 @@
         }
     }
     return sgImagesCount;
+}
 
+int HbIconDataCache::totalSgImagesCost() const
+{
+    int sgImagesCost = 0;
+    QHash<HbIconKey, HbIconCacheItem*>::const_iterator itEnd(cache->constEnd());
+    for (QHash<HbIconKey,
+            HbIconCacheItem *>::const_iterator iter = cache->constBegin();
+            iter != itEnd;
+            ++iter) {
+        HbIconCacheItem *temp = iter.value();
+        if( temp->rasterIconData.type == SGIMAGE ){
+            sgImagesCost += temp->rasterIconDataCost;
+        }
+    }
+    return sgImagesCost;
 }
 
 int HbIconDataCache::cachedPixmapCount() const