diff -r 7333d7932ef7 -r 8b7f4e561641 appinstaller/AppinstUi/Daemon/Src/installationFailedAppsCache.cpp --- a/appinstaller/AppinstUi/Daemon/Src/installationFailedAppsCache.cpp Tue Aug 31 15:21:33 2010 +0300 +++ b/appinstaller/AppinstUi/Daemon/Src/installationFailedAppsCache.cpp Wed Sep 01 12:22:02 2010 +0100 @@ -23,13 +23,14 @@ #include "sisregistrysession.h" #include "sisregistryentry.h" #include "sisregistrypackage.h" -#include "installationFailedAppsCache.h" -#include "SWInstDebug.h" using namespace Swi; +#include "installationFailedAppsCache.h" + _LIT(KInstFaildeApps, "c:\\private\\10202DCE\\instFailedAppsCache.dat"); +#include "SWInstDebug.h" // ---------------------------- // Borrowed from cleanuputils.h:- @@ -74,10 +75,6 @@ // End of code from swi/inc/cleanuputils.h -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// CInstallationFailedAppsCache *CInstallationFailedAppsCache::NewL() { FLOG( _L("Daemon: CInstallationFailedAppsCache::NewL") ); @@ -89,37 +86,26 @@ return self; } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + CInstallationFailedAppsCache::~CInstallationFailedAppsCache() { iUidsArray.Reset(); } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + void CInstallationFailedAppsCache::AddPackageUID( TUid aUid ) { - FLOG( _L("Daemon: CInstallationFailedAppsCache::AddPackageUID") ); - FLOG_1( _L("Daemon: AddPackageUID: Add UID = 0x%x"), aUid.iUid ); + FLOG( _L("Daemon: CInstallationFailedAppsCache::AddPackageUID") ); (void)iUidsArray.InsertInSignedKeyOrder( aUid ); // New UID added to array. Let's write cache to disk. iNewUID = ETrue; } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// -TBool CInstallationFailedAppsCache::HasPreviousInstallationFailed( - TUid aUid ) + +TBool CInstallationFailedAppsCache::HasPreviousInstallationFailed( TUid aUid ) { - FLOG( _L("Daemon: FailedAppsCache::HasPreviousInstallationFailed") ); + FLOG( _L("Daemon: CInstallationFailedAppsCache::HasPreviousInstallationFailed") ); if ( iUidsArray.FindInSignedKeyOrder( aUid ) == KErrNotFound ) { @@ -131,25 +117,17 @@ return ETrue; } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + CInstallationFailedAppsCache::CInstallationFailedAppsCache() { } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + void CInstallationFailedAppsCache::ConstructL() { User::LeaveIfError( iFs.Connect() ); TInt drive = 0; - iFs.CharToDrive( TParsePtrC( - PathInfo::PhoneMemoryRootPath() ).Drive()[0], drive ); - + iFs.CharToDrive( TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive()[0], drive ); iFs.CreatePrivatePath( drive ); iNewUID = EFalse; @@ -158,10 +136,7 @@ TRAP_IGNORE( InitFromCacheFileL() ); } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + void CInstallationFailedAppsCache::InitFromCacheFileL() { FLOG( _L("Daemon: CInstallationFailedAppsCache::InitFromCacheFileL") ); @@ -169,9 +144,7 @@ // Read in existing cache file. RFile cacheFile; - TInt err = cacheFile.Open( iFs, - KInstFaildeApps, - EFileStream|EFileRead ); + TInt err = cacheFile.Open( iFs, KInstFaildeApps, EFileStream|EFileRead ); if ( err != KErrNone ) { @@ -201,10 +174,7 @@ CleanupStack::PopAndDestroy(&cacheFile); } -// ----------------------------------------------------------------------- -// -// ----------------------------------------------------------------------- -// + void CInstallationFailedAppsCache::FlushToDiskL() { FLOG( _L("Daemon: CInstallationFailedAppsCache::FlushToDiskL") ); @@ -214,17 +184,13 @@ { FLOG( _L("Daemon: Write cache to disk") ); RFile cacheFile; - TInt err = cacheFile.Open( iFs, - KInstFaildeApps, - EFileStream|EFileWrite ); + TInt err = cacheFile.Open( iFs, KInstFaildeApps, EFileStream|EFileWrite ); // If cache was not found, create cache file. if ( err != KErrNone ) { FLOG( _L("Daemon: Create cache file.") ); - User::LeaveIfError( cacheFile.Create( iFs, - KInstFaildeApps, - EFileStream|EFileWrite ) ); + User::LeaveIfError( cacheFile.Create( iFs, KInstFaildeApps, EFileStream|EFileWrite ) ); } CleanupClosePushL(cacheFile);