homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp
branchRCL_3
changeset 18 bd874ee5e5e2
parent 0 79c6a41cd166
child 19 502e5d91ad42
equal deleted inserted replaced
9:d0529222e3f0 18:bd874ee5e5e2
    61 // ChspsDefinitionRepository::ChspsDefinitionRepository
    61 // ChspsDefinitionRepository::ChspsDefinitionRepository
    62 // C++ default constructor can NOT contain any code, that
    62 // C++ default constructor can NOT contain any code, that
    63 // might leave.
    63 // might leave.
    64 // -----------------------------------------------------------------------------
    64 // -----------------------------------------------------------------------------
    65 //
    65 //
    66 ChspsDefinitionRepository::ChspsDefinitionRepository()
    66 ChspsDefinitionRepository::ChspsDefinitionRepository() :
    67     {
    67         iCacheLastODT( NULL )
       
    68     {        
    68     }
    69     }
    69 
    70 
    70 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    71 // ChspsDefinitionRepository::ConstructL
    72 // ChspsDefinitionRepository::ConstructL
    72 // Symbian 2nd phase constructor can leave.
    73 // Symbian 2nd phase constructor can leave.
   120     iRepositoryInfoQueue.Close();
   121     iRepositoryInfoQueue.Close();
   121     iObservers.Reset();
   122     iObservers.Reset();
   122     iObservers.Close(); 
   123     iObservers.Close(); 
   123     delete iPath;
   124     delete iPath;
   124     
   125     
       
   126     delete iCacheLastODT;    
       
   127     
   125 	iTempFileName1 = KNullDesC;
   128 	iTempFileName1 = KNullDesC;
   126 	iTempFileName2 = KNullDesC;    
   129 	iTempFileName2 = KNullDesC;    
   127     }
   130     }
   128 
   131 
   129 // -----------------------------------------------------------------------------
   132 // -----------------------------------------------------------------------------
   198         {
   201         {
   199         iLogBus->LogText( _L( "ChspsDefinitionRepository::SetOdtL(): - rewriting done. return code: %d." ), ret );
   202         iLogBus->LogText( _L( "ChspsDefinitionRepository::SetOdtL(): - rewriting done. return code: %d." ), ret );
   200         }
   203         }
   201 #endif
   204 #endif
   202 
   205 
       
   206     if( aODT.ConfigurationType() == EhspsAppConfiguration )
       
   207         {
       
   208         delete iCacheLastODT;
       
   209 		iCacheLastODT = NULL;        
       
   210         iCacheLastODT = aODT.CloneL();                
       
   211         }
       
   212     
   203     return ret;
   213     return ret;
   204     }
   214     }
   205 
   215 
   206 // -----------------------------------------------------------------------------
   216 // -----------------------------------------------------------------------------
   207 // ChspsDefinitionRepository::GetOdtL
   217 // ChspsDefinitionRepository::GetOdtL
   210 // -----------------------------------------------------------------------------
   220 // -----------------------------------------------------------------------------
   211 //
   221 //
   212 EXPORT_C TInt ChspsDefinitionRepository::GetOdtL( ChspsODT& aODT )
   222 EXPORT_C TInt ChspsDefinitionRepository::GetOdtL( ChspsODT& aODT )
   213     {
   223     {
   214     TInt errorCode = KErrNone;
   224     TInt errorCode = KErrNone;
       
   225     
   215     if ( aODT.Flags() & EhspsThemeStatusLicenceeDefault )
   226     if ( aODT.Flags() & EhspsThemeStatusLicenceeDefault )
   216 		{
   227 		{
   217 		iLicenseDefault = ETrue;
   228 		iLicenseDefault = ETrue;
   218 		}
   229 		}
   219 	else
   230 	else
   220 		{
   231 		{
   221 		iLicenseDefault = EFalse;		
   232 		iLicenseDefault = EFalse;		
   222 		}
   233 		}
   223 
   234 
   224     TRAP( errorCode, GetPathL( aODT, EResourceODT ));
   235     if( iCacheLastODT &&
   225     if ( !errorCode )
   236         iCacheLastODT->RootUid() == aODT.RootUid() &&
   226     	{
   237         iCacheLastODT->ThemeUid() == aODT.ThemeUid() )  
   227     	errorCode = ReadFromFileL( *iPath, aODT ); 
   238         {
   228     	}
   239         aODT.CloneL( *iCacheLastODT );
   229     iLicenseDefault = EFalse;  
   240         }
       
   241     else       
       
   242         {    
       
   243         TRAP( errorCode, GetPathL( aODT, EResourceODT ));
       
   244         if ( !errorCode )
       
   245             {
       
   246             errorCode = ReadFromFileL( *iPath, aODT ); 
       
   247             }         
       
   248         }
       
   249     
       
   250     iLicenseDefault = EFalse;
       
   251     
   230     return errorCode;
   252     return errorCode;
   231     }
   253     }
   232 
   254 
   233 // -----------------------------------------------------------------------------
   255 // -----------------------------------------------------------------------------
   234 // ChspsDefinitionRepository::GetOdtHeaderL
   256 // ChspsDefinitionRepository::GetOdtHeaderL