skins/AknSkins/sdcsrc/SDCData.cpp
branchRCL_3
changeset 55 33ddb261ab37
parent 32 d9c996538b26
equal deleted inserted replaced
54:08459e712984 55:33ddb261ab37
   265 
   265 
   266     entry = new TSDCMBMEntry();
   266     entry = new TSDCMBMEntry();
   267     
   267     
   268     //check file
   268     //check file
   269    	if( !CheckFile( iBmpPath , aFilename ) )
   269    	if( !CheckFile( iBmpPath , aFilename ) )
   270 		   	{
   270         {
   271 			  char filename[512];
   271         char filename[512];
   272 			  CSDCInput::ConvertToAscii( filename, aFilename );
   272         CSDCInput::ConvertToAscii( filename, aFilename );
   273 		    printf("NOTE: item %s not add beacuse file not exist!!\n",filename);
   273         printf("NOTE: item %s not add beacuse file not exist!!\n",filename);
   274 		    return entry;
   274         return entry;
   275 		   	}
   275         }
   276 
   276 
   277     entry->iIndex = iNextIconIndex;
   277     entry->iIndex = iNextIconIndex;
   278     iNextIconIndex += 2;
   278     iNextIconIndex += 2;
   279 
   279 
   280     wcscpy( entry->iSourceFilename, aFilename );
   280     wcscpy( entry->iSourceFilename, aFilename );
   299         }
   299         }
   300     else
   300     else
   301         {
   301         {
   302         wcscpy( iBmpPath, aPath );
   302         wcscpy( iBmpPath, aPath );
   303         if( wcslen( iBmpPath ) &&
   303         if( wcslen( iBmpPath ) &&
   304             wcscmp( iBmpPath+wcslen(iBmpPath)-1, L"\\" ) )
   304             wcscmp( iBmpPath+wcslen(iBmpPath)-1, L"/" ) )
   305             {
   305             {
   306             wcscat( iBmpPath, L"\\" );
   306             wcscat( iBmpPath, L"/" );
   307             printf("NOTE: Trailing backslash appended to bitmap path\n");
   307             printf("NOTE: Trailing backslash appended to bitmap path\n");
   308             }
   308             }
   309         }
   309         }
   310     }
   310     }
   311 
   311 
   442     iAnimationDefVector.push_back( entry );
   442     iAnimationDefVector.push_back( entry );
   443     }
   443     }
   444     
   444     
   445     
   445     
   446 bool CSDCData::CheckFile( const wchar_t* aPath , const wchar_t* aFileName )
   446 bool CSDCData::CheckFile( const wchar_t* aPath , const wchar_t* aFileName )
   447 		{
   447     {
   448 		char asciiPatch[512];
   448     char asciiPatch[512];
   449 		CSDCInput::ConvertToAscii( asciiPatch, aPath );
   449     CSDCInput::ConvertToAscii( asciiPatch, aPath );
   450 		char asciiFileName[512];
   450     char asciiFileName[512];
   451 		CSDCInput::ConvertToAscii( asciiFileName, aFileName );
   451     CSDCInput::ConvertToAscii( asciiFileName, aFileName );
   452 		
   452 		
   453 		strcat(asciiPatch,asciiFileName);
   453     strcat(asciiPatch,asciiFileName);
   454 
   454 
   455     struct stat buf;
   455     struct stat buf;
   456     int result = stat( asciiPatch, &buf );
   456     int result = stat( asciiPatch, &buf );
   457     if(result == -1)
   457     if(result == -1)
   458 		    {
   458         {
   459 		    return false;
   459         return false;
   460 		    }
   460         }
   461     return true;
   461     return true;
   462     
   462     
   463 		}
   463     }
   464 
   464 
   465 // End of file
   465 // End of file