src/hbservers/hbthemeserver/hbthemeserver_symbian.cpp
changeset 5 627c4a0fd0e7
parent 3 11d3954df52a
child 6 c3690ec91ef8
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    61 // 5 MB  CPU cache size
    61 // 5 MB  CPU cache size
    62 #define CPU_CACHE_SIZE 0x500000
    62 #define CPU_CACHE_SIZE 0x500000
    63 
    63 
    64 static const TInt KThemeName = 0;
    64 static const TInt KThemeName = 0;
    65 
    65 
    66 const QString KOperatorCPath = "C:/resource/hb/operatorTheme/icons/";
    66 const QString KOperatorCPath = "C:/resource/hb/prioritytheme/icons/";
    67 const QString KOperatorZPath = "Z:/resource/hb/operatorTheme/icons/";
    67 const QString KOperatorZPath = "Z:/resource/hb/prioritytheme/icons/";
    68 
    68 
    69 bool HbThemeServerPrivate::gpuGoodMemoryState = true;
    69 bool HbThemeServerPrivate::gpuGoodMemoryState = true;
    70 // This is used as parent theme always regardless of the active theme
    70 // This is used as parent theme always regardless of the active theme
    71 
    71 
    72 //**********************************
    72 //**********************************
   106     // Store the active theme name in a member string
   106     // Store the active theme name in a member string
   107     iCurrentThemeName = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting);    
   107     iCurrentThemeName = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting);    
   108 
   108 
   109     if (iCurrentThemeName.isEmpty()) {
   109     if (iCurrentThemeName.isEmpty()) {
   110         iCurrentThemeName = HbThemeUtils::defaultTheme().name;
   110         iCurrentThemeName = HbThemeUtils::defaultTheme().name;
   111         // Set the current theme also in the cenrep key that is used to notify clients.
       
   112         HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, iCurrentThemeName);
       
   113     }
   111     }
   114 
   112 
   115     // Cache ROM theme(name)s
   113     // Cache ROM theme(name)s
   116     QString romPath = "Z:\\resource\\hb\\themes\\icons\\";
   114     QString romPath = "Z:\\resource\\hb\\themes\\icons\\";
   117     QDir dir(romPath);
   115     QDir dir(romPath);
   118     romThemeNames = dir.entryList(QDir::Dirs);
   116     romThemeNames = dir.entryList(QDir::Dirs);
       
   117 
       
   118     // Resolve the path of the current theme
       
   119     QDir path(iCurrentThemeName);
       
   120     if (!path.isAbsolute()) {
       
   121         // Resolve the path of the current theme
       
   122         resolveThemePath(iCurrentThemeName, iCurrentThemePath);
       
   123     } else {
       
   124         iCurrentThemeName = path.dirName();
       
   125         iCurrentThemePath = path.absolutePath();
       
   126     }          
   119     
   127     
   120     // Resolve the path of the current theme
       
   121     resolveThemePath(iCurrentThemeName, iCurrentThemePath);
       
   122     
       
   123     // Register theme system effects in construction
       
   124     // TODO: fix parameter
       
   125     HbThemeSystemEffect::handleThemeChange(iCurrentThemeName);
       
   126 
       
   127     // Open index file to prevent uninstallation of the active theme
   128     // Open index file to prevent uninstallation of the active theme
   128     if (!openCurrentIndexFile()) {
   129     if (!openCurrentIndexFile()) {
   129         // theme doesn't exist activate default theme
   130         // theme doesn't exist activate default theme
   130         iCurrentThemeName = HbThemeUtils::defaultTheme().name;
   131         iCurrentThemeName = HbThemeUtils::defaultTheme().name;
   131         resolveThemePath(iCurrentThemeName, iCurrentThemePath);
   132         resolveThemePath(iCurrentThemeName, iCurrentThemePath);
   152 #endif
   153 #endif
   153     
   154     
   154     // Process base theme index, it is used as parent index also when the current theme is something else
   155     // Process base theme index, it is used as parent index also when the current theme is something else
   155     QString basePath;
   156     QString basePath;
   156     resolveThemePath(HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting), basePath);
   157     resolveThemePath(HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting), basePath);
   157     createThemeIndex(basePath, BaseTheme);
   158     
       
   159     HbThemeServerUtils::createThemeIndex(basePath, BaseTheme);
   158     // Process operator theme indexes
   160     // Process operator theme indexes
   159     QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting);
   161     QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting);
   160     if (!operatorName.isEmpty()) {
   162     if (!operatorName.isEmpty()) {
   161         QString operatorPath;
   163         QString operatorPath;
   162         operatorPath.append(KOperatorCPath);
   164         operatorPath.append(KOperatorCPath);
   163         operatorPath.append(operatorName);
   165         operatorPath.append(operatorName);
   164         createThemeIndex(operatorPath, OperatorC);
   166         HbThemeServerUtils::createThemeIndex(operatorPath, OperatorC);
   165         // Process operator Drive Z theme index
   167         // Process operator Drive Z theme index
   166         QString operatorROMPath;
   168         QString operatorROMPath;
   167         operatorROMPath.append(KOperatorZPath);
   169         operatorROMPath.append(KOperatorZPath);
   168         operatorROMPath.append(operatorName);
   170         operatorROMPath.append(operatorName);
   169         createThemeIndex(operatorROMPath, OperatorROM);
   171         HbThemeServerUtils::createThemeIndex(operatorROMPath, OperatorROM);
   170     }
   172     }
   171     // Process current theme index
   173     // Process current theme index
   172     createThemeIndex(iCurrentThemePath, ActiveTheme);
   174     HbThemeServerUtils::createThemeIndex(iCurrentThemePath, ActiveTheme);
   173 	
   175 
       
   176     // Register theme system effects in construction
       
   177     // TODO: fix parameter
       
   178     HbThemeSystemEffect::handleThemeChange(iCurrentThemeName);
       
   179 
       
   180     // Set the current theme also in the cenrep key that is used to notify clients.
       
   181     HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, iCurrentThemePath);    
       
   182     
   174     // Temporary hack for pre-loading app. background graphics in server startup to give more realistic
   183     // Temporary hack for pre-loading app. background graphics in server startup to give more realistic
   175     // results in performance tests. (Normally these graphics get loaded anyway when the first hb app is started.)
   184     // results in performance tests. (Normally these graphics get loaded anyway when the first hb app is started.)
   176 #ifndef HB_NVG_CS_ICON
   185 #ifndef HB_NVG_CS_ICON
   177     QProcess::startDetached("hbiconpreloader.exe");
   186     QProcess::startDetached("hbiconpreloader.exe");
   178 #endif
   187 #endif
   258     return true;
   267     return true;
   259 }
   268 }
   260 
   269 
   261 bool HbThemeServerPrivate::resolveThemePath(const QString &themeName, QString &themePath)
   270 bool HbThemeServerPrivate::resolveThemePath(const QString &themeName, QString &themePath)
   262 {
   271 {
   263     if(themeName == "hbdefault") {
   272     if (themeName == "hbdefault") {
   264         themePath = ":\\themes\\icons\\hbdefault";
   273         themePath = ":\\themes\\icons\\hbdefault";
   265         return true;
   274         return true;
   266     }
   275     }
   267     
   276     
   268     if (!themeName.isEmpty()) {
   277     if (!themeName.isEmpty()) {
   327 
   336 
   328     QDir path(cleanThemeName);
   337     QDir path(cleanThemeName);
   329     if (!path.isAbsolute()) {
   338     if (!path.isAbsolute()) {
   330         // Resolve the path of the current theme
   339         // Resolve the path of the current theme
   331         resolveThemePath(iCurrentThemeName, iCurrentThemePath);
   340         resolveThemePath(iCurrentThemeName, iCurrentThemePath);
       
   341     } else {
       
   342         iCurrentThemeName = path.dirName();
       
   343         iCurrentThemePath = path.absolutePath();
   332     }
   344     }
   333     
   345     
   334     #ifdef THEME_INDEX_TRACES
   346     #ifdef THEME_INDEX_TRACES
   335     qDebug() << "ThemeIndex: theme change request, new theme =" << cleanThemeName.toUtf8();
   347     qDebug() << "ThemeIndex: theme change request, new theme =" << cleanThemeName.toUtf8();
   336     #endif
   348     #endif
   347     QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting);
   359     QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting);
   348     if (!operatorName.isEmpty()) {
   360     if (!operatorName.isEmpty()) {
   349         QString operatorPath;
   361         QString operatorPath;
   350         operatorPath.append(KOperatorCPath);
   362         operatorPath.append(KOperatorCPath);
   351         operatorPath.append(operatorName);
   363         operatorPath.append(operatorName);
   352         createThemeIndex(operatorPath, OperatorC);
   364         HbThemeServerUtils::createThemeIndex(operatorPath, OperatorC);
   353     }
   365     }
   354     // Process current theme index
   366     // Process current theme index
   355     createThemeIndex(iCurrentThemePath, ActiveTheme);
   367     HbThemeServerUtils::createThemeIndex(iCurrentThemePath, ActiveTheme);
   356 
   368 
   357     // Clear cached icons and session data
   369     // Clear cached icons and session data
   358     clearIconCache();
   370     clearIconCache();
   359     iSessionIter.SetToFirst();
   371     iSessionIter.SetToFirst();
   360     while(iSessionIter) {
   372     while(iSessionIter) {
   362         session.ClearSessionData();
   374         session.ClearSessionData();
   363         iSessionIter++;
   375         iSessionIter++;
   364     }
   376     }
   365 	
   377 	
   366     // TODO: fix parameter
   378     // TODO: fix parameter
   367     HbThemeSystemEffect::handleThemeChange(cleanThemeName);
   379     HbThemeSystemEffect::handleThemeChange(iCurrentThemeName);
   368  
   380  
   369     // Update settings and notify clients
   381     // Update settings and notify clients
   370     HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting,iCurrentThemeName);
   382     HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting,iCurrentThemePath);
   371 }
   383 }
   372 
   384 
   373 /**
   385 /**
   374 Creates a new session with the server.
   386 Creates a new session with the server.
   375 */
   387 */
   434 HbCacheItem * HbThemeServerPrivate::cssCacheItem(const QString &key)
   446 HbCacheItem * HbThemeServerPrivate::cssCacheItem(const QString &key)
   435 {
   447 {
   436     return(cssCache->cacheItem(key));
   448     return(cssCache->cacheItem(key));
   437 }
   449 }
   438 
   450 
   439 void HbThemeServerPrivate::insertIconDefaultSizeCacheItem(const QString &key, const QSizeF &item)
       
   440 {
       
   441     iconDefaultSizes.insert(key, item);
       
   442 }
       
   443 
       
   444 QSizeF HbThemeServerPrivate::iconDefaultSizeCacheItem(const QString &key)
       
   445 {
       
   446     return iconDefaultSizes.value(key);
       
   447 }
       
   448 
       
   449 /**
   451 /**
   450  * HbThemeServerPrivate::clearIconCache
   452  * HbThemeServerPrivate::clearIconCache
   451  *
   453  *
   452  * Clears icon cache.
   454  * Clears icon cache.
   453  */
   455  */
   537 {
   539 {
   538     gpuGoodMemoryState = true;
   540     gpuGoodMemoryState = true;
   539     cache->memoryGood();
   541     cache->memoryGood();
   540 }
   542 }
   541 
   543 
   542 void HbThemeServerPrivate::FreeGpuRam(int bytes)
   544 void HbThemeServerPrivate::FreeGpuRam(int bytes, bool useSwRendering )
   543 {
   545 {
   544     gpuGoodMemoryState = false;
   546     gpuGoodMemoryState = false;
   545     cache->freeGpuRam(bytes);
   547     cache->freeGpuRam(bytes, useSwRendering);
   546 #ifdef HB_SGIMAGE_ICON
   548 #ifdef HB_SGIMAGE_ICON
       
   549     if (useSwRendering) {
   547     HbSgImageRenderer::global()->terminate();
   550     HbSgImageRenderer::global()->terminate();
       
   551     }    	
   548 #endif
   552 #endif
   549 }
   553 }
   550 
   554 
   551 /**
   555 /**
   552  *  HbThemeServerPrivate::freeUnusedGpuResources
   556  *  HbThemeServerPrivate::freeUnusedGpuResources
   725  */
   729  */
   726 void HbThemeServerPrivate::doCleanup()
   730 void HbThemeServerPrivate::doCleanup()
   727 {
   731 {
   728     HbThemeServerUtils::cleanupUnusedCss(cssCache);
   732     HbThemeServerUtils::cleanupUnusedCss(cssCache);
   729 }
   733 }
   730 
       
   731 void HbThemeServerPrivate::createThemeIndex(const QString &themePath, const HbThemeType &themetype)
       
   732 {
       
   733     #ifdef THEME_INDEX_TRACES
       
   734     qDebug() <<  "ThemeIndex: createThemeIndex" << themePath.toUtf8();
       
   735     #endif
       
   736     QDir themeBasePath(themePath);
       
   737     // Path is like "C:/resource/hb/themes/icons/sfwhitetheme"
       
   738     QString themeName = themeBasePath.dirName();
       
   739     
       
   740     QString filename(themeBasePath.absolutePath());
       
   741     int cutindex = filename.lastIndexOf("/",filename.lastIndexOf("/")-1)+1;
       
   742     filename = filename.left(cutindex);
       
   743     themeBasePath.setPath(filename);
       
   744     filename.append(themeName);
       
   745     filename.append(".themeindex");
       
   746 
       
   747     if (themePath == ":\\themes\\icons\\hbdefault") {
       
   748         themeBasePath.setPath(":/themes");
       
   749         filename = ":/themes/hbdefault.themeindex";
       
   750         themeName = "hbdefault";
       
   751     }
       
   752     
       
   753     QFile indexFile(filename);
       
   754 
       
   755     bool indexOK = false;
       
   756 
       
   757     if (indexFile.open(QIODevice::ReadOnly)) {
       
   758 
       
   759         indexOK = true;
       
   760 
       
   761         GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory);
       
   762 
       
   763         HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*) manager->base();
       
   764         
       
   765         qint64 byteSize = indexFile.size();
       
   766 
       
   767         #ifdef THEME_INDEX_TRACES
       
   768         qDebug() <<  "ThemeIndex: " << themeName.toUtf8() << " index file size:" << byteSize;
       
   769         #endif
       
   770 
       
   771         int offset = manager->alloc(byteSize);
       
   772         if (offset >= 0) {
       
   773             #ifdef THEME_INDEX_TRACES
       
   774             qDebug() <<  "ThemeIndex: memory allocated for theme: " << themeName.toUtf8();
       
   775             #endif
       
   776 
       
   777             // Read the theme index in the shared chunk
       
   778             char *address = HbMemoryUtils::getAddress<char>(HbMemoryManager::SharedMemory, offset);
       
   779 
       
   780             indexFile.read(address, byteSize);
       
   781             indexFile.close();
       
   782 
       
   783             #ifdef THEME_INDEX_TRACES
       
   784             qDebug() <<  "ThemeIndex: Reading themeindex for theme" << themeName.toUtf8() << "... Done!";
       
   785             #endif
       
   786 
       
   787             // Verify theme index contents if it is not located in ROM,
       
   788             // so that it does not have over-indexing offsets which might
       
   789             // crash all the clients trying to read from it.
       
   790 
       
   791             if (themePath[0] != 'z' && themePath[0] != 'Z') {
       
   792                 #ifdef THEME_INDEX_TRACES
       
   793                 qDebug() <<  "ThemeIndex: Validating themeindex for theme" << themeName.toUtf8();
       
   794                 #endif
       
   795 
       
   796                 HbThemeIndex index(address);
       
   797                 indexOK = index.validateItems(byteSize);
       
   798 
       
   799                 #ifdef THEME_INDEX_TRACES
       
   800                 qDebug() <<  "ThemeIndex: Validating themeindex for theme" << themeName.toUtf8() << " done! Result: " << indexOK;
       
   801                 #endif
       
   802             }
       
   803 
       
   804             if (indexOK) {
       
   805                 // Allocate theme path string from shared memory
       
   806                 QByteArray themePathArray = themeBasePath.absolutePath().toLatin1();
       
   807                 quint32 themePathOffset = manager->alloc(themePathArray.size()+1);
       
   808                 memcpy(HbMemoryUtils::getAddress<char>(
       
   809                            HbMemoryManager::SharedMemory,
       
   810                            themePathOffset),
       
   811                            themePathArray.data(),
       
   812                            themePathArray.size()+1); // +1 for '/0'
       
   813 
       
   814                 // Allocate theme name string from shared memory
       
   815                 QByteArray themeNameArray = themeName.toLatin1();
       
   816                 quint32 themeNameOffset = manager->alloc(themeNameArray.size()+1);
       
   817                 memcpy(HbMemoryUtils::getAddress<char>(
       
   818                            HbMemoryManager::SharedMemory,
       
   819                            themeNameOffset),
       
   820                            themeNameArray.data(),
       
   821                            themeNameArray.size()+1); // +1 for '/0'
       
   822 
       
   823                 // Store offset to the index in chunk
       
   824                 switch (themetype) {
       
   825                 case BaseTheme:
       
   826                     // Release previously allocated content
       
   827                     manager->free(chunkHeader->baseThemePathOffset);
       
   828                     manager->free(chunkHeader->baseThemeNameOffset);
       
   829                     manager->free(chunkHeader->baseThemeIndexOffset);
       
   830                     // Base theme offsets
       
   831                     chunkHeader->baseThemePathOffset = themePathOffset;
       
   832                     chunkHeader->baseThemeNameOffset = themeNameOffset;
       
   833                     chunkHeader->baseThemeIndexOffset = offset;
       
   834                     break;
       
   835                 case OperatorC:
       
   836                     // Release previously allocated content
       
   837                     manager->free(chunkHeader->operatorThemeDriveCPathOffset);
       
   838                     manager->free(chunkHeader->operatorThemeDriveCNameOffset);
       
   839                     manager->free(chunkHeader->operatorThemeDriveCIndexOffset);
       
   840                     // Operator theme in C-drive offsets
       
   841                     chunkHeader->operatorThemeDriveCPathOffset = themePathOffset;
       
   842                     chunkHeader->operatorThemeDriveCNameOffset = themeNameOffset;
       
   843                     chunkHeader->operatorThemeDriveCIndexOffset = offset;
       
   844                     break;
       
   845                 case OperatorROM:
       
   846                     // Release previously allocated content
       
   847                     manager->free(chunkHeader->operatorThemeRomPathOffset);
       
   848                     manager->free(chunkHeader->operatorThemeRomNameOffset);
       
   849                     manager->free(chunkHeader->operatorThemeRomIndexOffset);
       
   850                     // Operator theme in ROM offsets
       
   851                     chunkHeader->operatorThemeRomPathOffset = themePathOffset;
       
   852                     chunkHeader->operatorThemeRomNameOffset = themeNameOffset;
       
   853                     chunkHeader->operatorThemeRomIndexOffset = offset;
       
   854                     break;
       
   855                 case ActiveTheme:
       
   856                     // Release previously allocated content
       
   857                     manager->free(chunkHeader->activeThemePathOffset);
       
   858                     manager->free(chunkHeader->activeThemeNameOffset);
       
   859                     manager->free(chunkHeader->activeThemeIndexOffset);
       
   860                     // Active theme offsets
       
   861                     chunkHeader->activeThemePathOffset = themePathOffset;
       
   862                     chunkHeader->activeThemeNameOffset = themeNameOffset;
       
   863                     chunkHeader->activeThemeIndexOffset = offset;
       
   864                     break;
       
   865                 default:
       
   866                     break;
       
   867                 }
       
   868             } else {
       
   869                 // If the index contents were not OK, remove the index from the chunk
       
   870                 manager->free(offset);
       
   871             }
       
   872         }
       
   873     }
       
   874 }
       
   875   
   734   
   876 //**********************************
   735 //**********************************
   877 //HbThemeServerSession
   736 //HbThemeServerSession
   878 //**********************************
   737 //**********************************
   879 /**
   738 /**
   971         HandleEffectAddAndFileLookupL(aMessage);
   830         HandleEffectAddAndFileLookupL(aMessage);
   972         break;
   831         break;
   973 
   832 
   974     case EIconLookup:
   833     case EIconLookup:
   975         GetSharedIconInfoL(aMessage);
   834         GetSharedIconInfoL(aMessage);
   976         break;
       
   977 
       
   978     case EIconDefaultSize:
       
   979         GetSharedIconDefaultSizeInfoL(aMessage);
       
   980         break;
   835         break;
   981 
   836 
   982     case EThemeSelection:
   837     case EThemeSelection:
   983         HandleThemeSelectionL(aMessage);
   838         HandleThemeSelectionL(aMessage);
   984         break;
   839         break;
  1175         TPckg<HbFreeRamNotificationData> paramPckg(params);
  1030         TPckg<HbFreeRamNotificationData> paramPckg(params);
  1176         aMessage.ReadL(0, paramPckg, 0);
  1031         aMessage.ReadL(0, paramPckg, 0);
  1177         if(params.useSwRendering){
  1032         if(params.useSwRendering){
  1178             iServer->setCurrentRenderingMode(ESWRendering );
  1033             iServer->setCurrentRenderingMode(ESWRendering );
  1179         }
  1034         }
  1180         iServer->FreeGpuRam(params.bytesToFree);
  1035         iServer->FreeGpuRam(params.bytesToFree, params.useSwRendering);
  1181         break;
  1036         break;
  1182     }
  1037     }
  1183 
  1038 
  1184     case ERenderModeSwitch: {
  1039     case ERenderModeSwitch: {
  1185         TInt mode = 0;
  1040         TInt mode = 0;
  1366     QString effFileName((QChar*)fileName.Ptr(), fileName.Length());
  1221     QString effFileName((QChar*)fileName.Ptr(), fileName.Length());
  1367     HbSharedEffectInfo offsetInfo;
  1222     HbSharedEffectInfo offsetInfo;
  1368     offsetInfo.offset = HbThemeServerUtils::getSharedEffect(effFileName);
  1223     offsetInfo.offset = HbThemeServerUtils::getSharedEffect(effFileName);
  1369     TPckg<HbSharedEffectInfo> data(offsetInfo);
  1224     TPckg<HbSharedEffectInfo> data(offsetInfo);
  1370     aMessage.WriteL(1, data);
  1225     aMessage.WriteL(1, data);
  1371 }
       
  1372 
       
  1373 void HbThemeServerSession::GetSharedIconDefaultSizeInfoL(const RMessage2 &aMessage)
       
  1374 {
       
  1375     TIconParams params = ReadMessageAndRetrieveParams(aMessage);
       
  1376 
       
  1377     // Need to be allocated from heap or the leave in the end causes a crash
       
  1378     QScopedPointer<QString> filenamePtr(new QString((QChar*)params.fileName.Ptr(), params.fileName.Length()));
       
  1379 
       
  1380     // See if the icon's default size has been queried already earlier and
       
  1381     // can be found stored in the hash.
       
  1382 
       
  1383     QSizeF defSize = iServer->iconDefaultSizeCacheItem(*filenamePtr.data());
       
  1384 
       
  1385     if (!defSize.isValid()) {
       
  1386         defSize = RetrieveIconDefaultSize(*filenamePtr.data());
       
  1387 
       
  1388         // If the default size was retrieved, insert it in the hash for further lookups
       
  1389         if (defSize.isValid()) {
       
  1390             iServer->insertIconDefaultSizeCacheItem(*filenamePtr.data(), defSize);
       
  1391         }
       
  1392     }
       
  1393 
       
  1394     // Return the default size back to the client if it was resolved
       
  1395     if (defSize.isValid()) {
       
  1396         TPckg<QSizeF> returnData(defSize);
       
  1397         aMessage.WriteL(1, returnData);
       
  1398 #ifdef THEME_SERVER_TRACES
       
  1399         qDebug() << "Completed aMessage.WriteL";
       
  1400 #endif
       
  1401     }
       
  1402     // Otherwise leave with error code
       
  1403     else {
       
  1404         User::Leave(KErrNotFound);
       
  1405     }
       
  1406 }
       
  1407 
       
  1408 QSizeF HbThemeServerSession::RetrieveIconDefaultSize(const QString &filename)
       
  1409 {
       
  1410     QSizeF ret;
       
  1411 
       
  1412     // Get icon source, previous icons sources are cached so if accessed again,
       
  1413     // they don't need to be loaded and parsed from a file always.
       
  1414     HbIconSource *source = HbThemeServerUtils::getIconSource(filename);
       
  1415     if (source) {
       
  1416         ret = source->defaultSize();
       
  1417     }
       
  1418 
       
  1419     return ret;
       
  1420 }
  1226 }
  1421 
  1227 
  1422 /**
  1228 /**
  1423  * GetSharedIconInfoL
  1229  * GetSharedIconInfoL
  1424  */
  1230  */