diff -r d0529222e3f0 -r bd874ee5e5e2 homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp --- a/homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp Fri Feb 19 23:07:29 2010 +0200 +++ b/homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp Fri Mar 12 15:43:54 2010 +0200 @@ -63,8 +63,9 @@ // might leave. // ----------------------------------------------------------------------------- // -ChspsDefinitionRepository::ChspsDefinitionRepository() - { +ChspsDefinitionRepository::ChspsDefinitionRepository() : + iCacheLastODT( NULL ) + { } // ----------------------------------------------------------------------------- @@ -122,6 +123,8 @@ iObservers.Close(); delete iPath; + delete iCacheLastODT; + iTempFileName1 = KNullDesC; iTempFileName2 = KNullDesC; } @@ -200,6 +203,13 @@ } #endif + if( aODT.ConfigurationType() == EhspsAppConfiguration ) + { + delete iCacheLastODT; + iCacheLastODT = NULL; + iCacheLastODT = aODT.CloneL(); + } + return ret; } @@ -212,6 +222,7 @@ EXPORT_C TInt ChspsDefinitionRepository::GetOdtL( ChspsODT& aODT ) { TInt errorCode = KErrNone; + if ( aODT.Flags() & EhspsThemeStatusLicenceeDefault ) { iLicenseDefault = ETrue; @@ -221,12 +232,23 @@ iLicenseDefault = EFalse; } - TRAP( errorCode, GetPathL( aODT, EResourceODT )); - if ( !errorCode ) - { - errorCode = ReadFromFileL( *iPath, aODT ); - } - iLicenseDefault = EFalse; + if( iCacheLastODT && + iCacheLastODT->RootUid() == aODT.RootUid() && + iCacheLastODT->ThemeUid() == aODT.ThemeUid() ) + { + aODT.CloneL( *iCacheLastODT ); + } + else + { + TRAP( errorCode, GetPathL( aODT, EResourceODT )); + if ( !errorCode ) + { + errorCode = ReadFromFileL( *iPath, aODT ); + } + } + + iLicenseDefault = EFalse; + return errorCode; }