homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp
branchRCL_3
changeset 64 b276298d5729
parent 59 a0713522ab97
child 74 edd621764147
equal deleted inserted replaced
59:a0713522ab97 64:b276298d5729
  4276         
  4276         
  4277     for ( TInt i = 0; i < iHeaderListCache.Count(); i++ )
  4277     for ( TInt i = 0; i < iHeaderListCache.Count(); i++ )
  4278         {
  4278         {
  4279         ChspsODT* header = iHeaderListCache.At( i );
  4279         ChspsODT* header = iHeaderListCache.At( i );
  4280         
  4280         
       
  4281         // Header clone is needed because it prevents modifying list cache
       
  4282         ChspsODT* clone = header->CloneL();
       
  4283         CleanupStack::PushL( clone ); 
       
  4284         
  4281         // Check whether the header matches the search criteria (family etc)
  4285         // Check whether the header matches the search criteria (family etc)
  4282         if ( FilterHeader( aSearchMask, *header ) )
  4286         if ( FilterHeader( aSearchMask, *clone ) )
  4283             {
  4287             {
  4284         
  4288         
  4285             // Update file paths into the existing logo declarations
  4289             // Update file paths into the existing logo declarations
  4286             if( header->LogoFile().Length() &&
  4290             if( clone->LogoFile().Length() &&
  4287                 iMaintainLogoResources &&
  4291                 iMaintainLogoResources &&
  4288                 ( header->ConfigurationType() == EhspsWidgetConfiguration ||
  4292                 ( header->ConfigurationType() == EhspsWidgetConfiguration ||
  4289                   header->ConfigurationType() == EhspsTemplateConfiguration ) )
  4293                   header->ConfigurationType() == EhspsTemplateConfiguration ) )
  4290                 {    
  4294                 {    
  4291             
  4295             
  4297                 CleanupClosePushL( sourceFile );
  4301                 CleanupClosePushL( sourceFile );
  4298                 sourceFile.CreateL( KMaxFileName );
  4302                 sourceFile.CreateL( KMaxFileName );
  4299                 
  4303                 
  4300                 RBuf newDeclaration;
  4304                 RBuf newDeclaration;
  4301                 CleanupClosePushL( newDeclaration );
  4305                 CleanupClosePushL( newDeclaration );
  4302                 newDeclaration.CreateL( header->LogoFile().Length() + KMaxFileName );
  4306                 newDeclaration.CreateL( clone->LogoFile().Length() + KMaxFileName );
  4303                 
  4307                 
  4304                 // Find location of the logo file and location where it shold be copied                
  4308                 // Find location of the logo file and location where it shold be copied                
  4305                 hspsServerUtil::PopulateLogoPathsL(
  4309                 hspsServerUtil::PopulateLogoPathsL(
  4306                     header->LogoFile(),
  4310                     clone->LogoFile(),
  4307                     iSecureId,
  4311                     iSecureId,
  4308                     targetFile,
  4312                     targetFile,
  4309                     sourceFile,
  4313                     sourceFile,
  4310                     newDeclaration );
  4314                     newDeclaration );
  4311                 
  4315                 
  4312                 if( targetFile.Length()
  4316                 if( targetFile.Length()
  4313                         && sourceFile.Length() 
  4317                         && sourceFile.Length() 
  4314                         && newDeclaration.Length() )
  4318                         && newDeclaration.Length() )
  4315                     {
  4319                     {
  4316                     // Update private path information to the logo declaration                
  4320                     // Update private path information to the logo declaration                
  4317                     header->SetLogoFileL( newDeclaration );
  4321                     clone->SetLogoFileL( newDeclaration );
  4318                                         
  4322                                         
  4319                     hspsServerUtil::CopyResourceFileL(
  4323                     hspsServerUtil::CopyResourceFileL(
  4320                         iServerSession->FileSystem(),
  4324                         iServerSession->FileSystem(),
  4321                         *iFileMan,                         
  4325                         *iFileMan,                         
  4322                         targetFile,
  4326                         targetFile,
  4325                 
  4329                 
  4326                 CleanupStack::PopAndDestroy( 3, &targetFile ); // targetFile, sourceFile, newDeclaration                
  4330                 CleanupStack::PopAndDestroy( 3, &targetFile ); // targetFile, sourceFile, newDeclaration                
  4327                 }      
  4331                 }      
  4328         
  4332         
  4329             // Convert the header to a descriptor
  4333             // Convert the header to a descriptor
  4330             HBufC8* data = header->MarshalHeaderL();            
  4334             HBufC8* data = clone->MarshalHeaderL();            
  4331             if ( data )
  4335             if ( data )
  4332                 {
  4336                 {
  4333                 // Append to the search results
  4337                 // Append to the search results
  4334                 CleanupStack::PushL( data );
  4338                 CleanupStack::PushL( data );
  4335                 aHeaderDataList.AppendL( data );
  4339                 aHeaderDataList.AppendL( data );
  4336                 CleanupStack::Pop( data );
  4340                 CleanupStack::Pop( data );
  4337                 }
  4341                 }
  4338             }
  4342             }
       
  4343         CleanupStack::PopAndDestroy( clone );
  4339         }          
  4344         }          
  4340     }
  4345     }
  4341 
  4346 
  4342 // -----------------------------------------------------------------------------
  4347 // -----------------------------------------------------------------------------
  4343 // ChspsMaintenanceHandler::RestoredDefaultL
  4348 // ChspsMaintenanceHandler::RestoredDefaultL