gfxconversion/mifconv/src/mifconv_argumentmanager.cpp
branchRCL_3
changeset 15 d3300267661e
parent 9 1f6339ced17d
equal deleted inserted replaced
10:478277bdf366 15:d3300267661e
   320          
   320          
   321     // Global icons folder can contain only .svg files:
   321     // Global icons folder can contain only .svg files:
   322     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_ICONS_PATH), vector<MifConvString>(1, SVG_FILE_EXTENSION)));
   322     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_ICONS_PATH), vector<MifConvString>(1, SVG_FILE_EXTENSION)));
   323     // Global bitmaps folder can contain only .bmp files:
   323     // Global bitmaps folder can contain only .bmp files:
   324     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_BITMAPS_PATH), vector<MifConvString>(1, BMP_FILE_EXTENSION)));
   324     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_BITMAPS_PATH), vector<MifConvString>(1, BMP_FILE_EXTENSION)));
       
   325     // If not found from global icons folder, try subfolder nss:
       
   326     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_ICONS_PATH + DIR_SEPARATOR + "nss"), vector<MifConvString>(1, SVG_FILE_EXTENSION)));
       
   327     // If not found from nss sub folder, try subfolder nokia:
       
   328     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_ICONS_PATH + DIR_SEPARATOR + "nokia"), vector<MifConvString>(1, SVG_FILE_EXTENSION)));
       
   329     // If not found from nokia sub folder, try subfolder oem:
       
   330     iSearchRules.push_back(MifConvSourceSearchRule(MifConvString(epocRoot + S60_ICONS_PATH + DIR_SEPARATOR + "oem"), vector<MifConvString>(1, SVG_FILE_EXTENSION)));    
   325     // EPOCROOT, if given in environment variables:
   331     // EPOCROOT, if given in environment variables:
   326     if( epocRoot.length() > 0 )
   332     if( epocRoot.length() > 0 )
   327     {
   333     {
   328         iSearchRules.push_back(MifConvSourceSearchRule(epocRoot+EPOC32_PATH, vector<MifConvString>(1, MIFCONV_WILDCARD)));
   334         iSearchRules.push_back(MifConvSourceSearchRule(epocRoot+EPOC32_PATH, vector<MifConvString>(1, MIFCONV_WILDCARD)));
   329     }
   335     }
   657 
   663 
   658 /**
   664 /**
   659  *
   665  *
   660  */
   666  */
   661 bool MifConvArgumentManager::FindAndSetPathAndType( MifConvSourceFile& srcFile, const MifConvString& extension )
   667 bool MifConvArgumentManager::FindAndSetPathAndType( MifConvSourceFile& srcFile, const MifConvString& extension )
   662 {    
   668 {   
   663     // Search the filename first "as is":
   669     // Search the filename first "as is":
   664     MifConvString tmp( MifConvUtil::FilenameWithoutExtension( srcFile.Filename() ) + MifConvString(FILE_EXTENSION_SEPARATOR) + extension );     
   670     MifConvString tmp( MifConvUtil::FilenameWithoutExtension( srcFile.Filename() ) + MifConvString(FILE_EXTENSION_SEPARATOR) + extension );     
   665     if( MifConvUtil::FileExists(tmp) )
   671     if( MifConvUtil::FileExists(tmp) )
   666     {
   672     {
   667         srcFile.SetFilename(tmp);
   673         srcFile.SetFilename(tmp);
   696         }
   702         }
   697 
   703 
   698         if( validPath )
   704         if( validPath )
   699         {            
   705         {            
   700             MifConvString searchPath(i->SearchPath());
   706             MifConvString searchPath(i->SearchPath());
   701 
   707                                   
   702             // Make sure that the last char is directory separator
   708             // Make sure that the last char is directory separator
   703             if( searchPath.length() > 0 && searchPath.at( searchPath.length()-1) != DIR_SEPARATOR2 )
   709             if( searchPath.length() > 0 && searchPath.at( searchPath.length()-1) != DIR_SEPARATOR2 )
   704             {
   710             {
   705                 searchPath += DIR_SEPARATOR;
   711                 searchPath += DIR_SEPARATOR;
   706             }
   712             }
   707 
   713 
   708             searchPath += MifConvUtil::FilenameWithoutExtension( srcFile.Filename() ) + MifConvString(FILE_EXTENSION_SEPARATOR) + extension;
   714             searchPath += MifConvUtil::FilenameWithoutExtension( srcFile.Filename() ) + MifConvString(FILE_EXTENSION_SEPARATOR) + extension;
   709 
   715 
   710             MifConvUtil::RemoveDuplicateDirSeparators(searchPath);
   716             MifConvUtil::RemoveDuplicateDirSeparators(searchPath);
   711 
   717            
   712             if( MifConvUtil::FileExists( searchPath ) )
   718             if( MifConvUtil::FileExists( searchPath ) )
   713             {
   719             {
   714                 srcFile.SetFilename(searchPath);
   720                 srcFile.SetFilename(searchPath);
   715                 MifConvUtil::FindAndSetBitmapMaskFile(srcFile);                
   721                 MifConvUtil::FindAndSetBitmapMaskFile(srcFile);
       
   722                                 
   716                 return true; 
   723                 return true; 
   717             }  
   724             }  
   718         }            
   725         }            
   719     }
   726     }
   720     return false;
   727     return false;