# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284490516 -10800 # Node ID 8baec10861afe10e671a98bbe9c8c4d40a5a6f79 # Parent a5a39a2951125f3d7e6b05bf7400303dcf0ff318 Revision: 201033 Kit: 201035 diff -r a5a39a295112 -r 8baec10861af contentcontrolsrv/ccsrv/src/ccsrv.cpp --- a/contentcontrolsrv/ccsrv/src/ccsrv.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentcontrolsrv/ccsrv/src/ccsrv.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -251,7 +251,7 @@ CCcSrv::TCcProvider provider; provider.iId = aProvider; provider.iSession = aSession; - iProviders.Append( provider ); + iProviders.AppendL( provider ); // Register possible active observers for ( TUint32 i = 0; i < iObservers.Count(); i++ ) @@ -283,7 +283,7 @@ CCcSrv::TCcObserver observer; observer.iProviderId = aProvider; observer.iObserver = aSession->Id(); - iObservers.Append( observer ); + iObservers.AppendL( observer ); } // ----------------------------------------------------------------------------- diff -r a5a39a295112 -r 8baec10861af contentcontrolsrv/ccsrv/src/ccsrvsession.cpp --- a/contentcontrolsrv/ccsrv/src/ccsrvsession.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentcontrolsrv/ccsrv/src/ccsrvsession.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -440,18 +440,18 @@ CCcSrvMsg* message = CCcSrvMsg::NewL(); CleanupStack::PushL( message ); message->InternalizeL( stream ); - message->SetMessage( aMessage ); + message->SetFunction( aMessage.Function() ); message->SetSender( iId ); + aMessage.Complete( KErrNone ); + // Forward notification to observers for ( TInt i = 0; i < iObservers.Count(); i++ ) { message->SetReceiver( iObservers[ i ] ); Server().SendMsgL( *message ); } - - message->Message().Complete( KErrNone ); - + CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( msgBuf ); } diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -29,14 +29,14 @@ _LIT8(KCachedMap, "cached_map"); -static const int KMaxCacheItems = 18; +static const int KMaxCacheItems = 24; // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // CCPActionDataCache* CCPActionDataCache::NewL() @@ -47,7 +47,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // CCPActionDataCache* CCPActionDataCache::NewLC() @@ -59,7 +59,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::ConstructL( ) @@ -68,7 +68,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // CCPActionDataCache::CCPActionDataCache() @@ -76,7 +76,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // CCPActionDataCache::~CCPActionDataCache() @@ -88,7 +88,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::HandleCacheRemoveL(const CLiwMap* aMap) @@ -101,7 +101,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::AppendL( const CLiwGenericParamList* aParamList) @@ -122,7 +122,7 @@ map->InsertL(KCachedMap, TLiwVariant(inputMap)); iInternalList->AppendL(TLiwVariant(map)); CleanupStack::PopAndDestroy(map); - + if (iInternalList->Count() > KMaxCacheItems) { iInternalList->Remove(0); @@ -131,7 +131,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::AppendEmptyL( const CLiwMap* aIdsMap ) @@ -147,7 +147,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::IsCacheableL(const CLiwMap* aMap) @@ -171,7 +171,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::ExistL(const CLiwMap* aMap) @@ -185,7 +185,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::GetL(const CLiwMap* aMap, @@ -211,7 +211,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::MatchL(const CLiwMap* aCachedMap, @@ -244,7 +244,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::TypesMatchL(const CLiwMap* aCachedMap, @@ -277,7 +277,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // void CCPActionDataCache::ExtractRBufL(const TLiwVariant& aVariant, RBuf& aBuf) @@ -299,7 +299,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::MatchL(const CLiwMap* aLeft, const CLiwMap* aRight, @@ -320,7 +320,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TBool CCPActionDataCache::IsSpecifiedL(const CLiwMap* aMap, @@ -339,7 +339,7 @@ } // --------------------------------------------------------------------------- -// +// // --------------------------------------------------------------------------- // TInt CCPActionDataCache::FindL(const CLiwMap* aKey) diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -22,15 +22,15 @@ TARGETTYPE dll UID 0x1000008D 0x2001CB6C - + CAPABILITY CAP_GENERAL_DLL VENDORID VID_DEFAULT LANG SC -SOURCEPATH ../src -SOURCE cpluginvalidator.cpp -SOURCE cblacklisthandler.cpp +SOURCEPATH ../src +SOURCE cpluginvalidator.cpp +SOURCE cblacklisthandler.cpp SOURCE charvesterpluginvalidator.cpp USERINCLUDE ../inc @@ -39,7 +39,8 @@ MW_LAYER_SYSTEMINCLUDE LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY estor.lib -LIBRARY centralrepository.lib +LIBRARY ecom.lib +LIBRARY estor.lib +LIBRARY centralrepository.lib +LIBRARY flogger.lib //end of file diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Tue Sep 14 21:55:16 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: - * +* */ @@ -100,7 +100,7 @@ * Callback used for delayed update */ static TInt UpdateCallback( TAny* aValidator ); - + private: /** @@ -114,12 +114,19 @@ * Own */ RProperty iInProgressProperty; - + /* * Idle AO used for delayed update * Own */ CIdle* iUpdateIdle; + + /** + * Array containing plugins to be updated. + * Own. + */ + RArray iUpdatePluginArray; + }; #endif // CHARVESTERPLUGINVALIDATOR_H diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/chplugindebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/chplugindebug.h Tue Sep 14 21:55:16 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef CPSDEBUG_H +#define CPSDEBUG_H + +// INCLUDES +#include +#include + +// Maximum formatted size resulting from a single DEBUG* call +#ifndef MAX_DEBUG_STRING_LENGTH +#define MAX_DEBUG_STRING_LENGTH 4096 +#endif + +#ifdef _DEBUG +// ---------------------------------------------------------- +// Debug file - debug output is disabled if the parent dir does not exist +_LIT(KPerformanceLogDir, "cps"); +_LIT(KPerformanceLogFile, "pluginvalidator_perf.txt"); + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +static void DoOutputPerf(TDesC8& aData) + { + RFileLogger::Write( KPerformanceLogDir, + KPerformanceLogFile, + EFileLoggingModeAppend, + aData ); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +static void DebugStringNarrowPerfL(const char* aFmt, ...) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast(aFmt)); + HBufC8* buf = HBufC8::NewLC(MAX_DEBUG_STRING_LENGTH); + buf->Des().FormatList(fmt, args); + buf->Des().Append('\n'); + + TTime timestamp; + timestamp.HomeTime(); + + TBuf<64> dateTimeString; + TBuf8<64> dateTimeString8; + + _LIT(KTimeString, "%:0%J%:1%T%:2%S%.%*C4%:3"); + timestamp.FormatL(dateTimeString, KTimeString); + dateTimeString8.Copy( dateTimeString ); + buf->Des().Insert( 0, _L8(" -> ") ); + buf->Des().Insert( 0, dateTimeString8 ); + + DoOutputPerf(*buf); + CleanupStack::PopAndDestroy(buf); + + VA_END(args); + } + +#define CPSPERF(x) TRAP_IGNORE( DebugStringNarrowPerfL x ) +#else +#define CPSPERF(x) +#endif + +#endif // CPSDEBUG_H \ No newline at end of file diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h Tue Sep 14 21:55:16 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -30,23 +30,23 @@ /** * Class containing information regarding a plugin * - * + * * @lib cpclient.dll * @since S60 v 5.0 */ NONSHARABLE_CLASS( TPluginInfo ) - { + { public: - TAny* iPlugin; // not own - TUid iImplementationUid; - TInt iVersion; - TUid iDtor_ID_Key; - }; + TAny* iPlugin; // not own + TUid iImplementationUid; + TInt iVersion; + TUid iDtor_ID_Key; + }; /** * Class used to maintain required ECOM plugins implementations * - * + * * @lib cpclient.dll * @since S60 v 5.0 */ @@ -56,15 +56,15 @@ /** * Two-phased constructor. - * - */ - IMPORT_C static CPluginValidator* NewL( TUid aUid, + * + */ + IMPORT_C static CPluginValidator* NewL( TUid aUid, TAny *aParameter = NULL ); /** * Two-phased constructor. - * - */ + * + */ IMPORT_C static CPluginValidator* NewLC( TUid aUid, TAny *aParameter = NULL ); @@ -73,7 +73,7 @@ * * @param aUid required plugin * @return pointer to plugin implementation - */ + */ IMPORT_C TAny* GetImplementation( TUid aUid ); /** @@ -81,19 +81,19 @@ * * @param aIndex index of plugin * @return pointer to plugin implementation - */ + */ IMPORT_C TAny* GetImplementation( TInt aIndex ); - + /** * Gets number of plugins * * @return number of plugins - */ + */ IMPORT_C TInt GetCount(); - + /** * Desctructor. - */ + */ virtual ~CPluginValidator(); protected: @@ -120,59 +120,59 @@ /** * C++ default constructor. - */ + */ CPluginValidator( TUid aUid, TAny *aParameter ); /** * Perform the second phase construction of a CPluginValidator object. - */ + */ void ConstructL(); - + /* * Checks if plugin is present in an array */ - TBool PresentInArrayL( TPluginInfo aPluginInfo, - const RImplInfoPtrArray& aInfoArray ); + TBool PresentInArrayL( TPluginInfo aPluginInfo, + const RImplInfoPtrArray& aInfoArray ); /* - * + * */ - void DestroyPlugin( TInt aIndex ); - + void DestroyPlugin( TInt aIndex ); + /** * Cleans plugins table; - */ + */ void CleanPluginsTable(); - + /** * Loads or destroys plugins - */ - virtual void ManagePluginsL(); + */ + virtual void ManagePluginsL(); /** * Loads ECOM plugins - */ - virtual void LoadPluginL( TPluginInfo& aPluginInfo ); - + */ + virtual void LoadPluginL( TPluginInfo& aPluginInfo ); + protected: - + /** * ECOM handler * Own. */ REComSession* iSession; - + /** * Array containing plugins * Own. */ RArray iPluginArray; - + /** * UID of the interface */ const TUid iUid; - + /** * Parameter to pass to the object creation method. */ diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -21,6 +21,7 @@ #include // harvesting plugin #include "charvesterpluginvalidator.h" #include "cblacklisthandler.h" +#include "chplugindebug.h" const TUint32 KInProgressPropertyKey = { @@ -70,6 +71,7 @@ iInProgressProperty.Close(); delete iBlacklist; delete iUpdateIdle; + iUpdatePluginArray.Close(); } // ---------------------------------------------------------------------------- @@ -91,7 +93,6 @@ { iBlacklist = CBlacklistHandler::NewL(); iUpdateIdle = CIdle::NewL( CActive::EPriorityIdle ); - iUpdateIdle->Start( TCallBack( UpdateCallback, this ) ); CPluginValidator::ConstructL(); } @@ -125,9 +126,13 @@ iBlacklist->CopyBlacklistL(ETrue); // set property value to 1 (which means "in progress") - iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, - 1); + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 1 ); CPluginValidator::ManagePluginsL(); + if( !iUpdateIdle->IsActive() ) + { + iUpdateIdle->Start( TCallBack( UpdateCallback, this ) ); + } // set property value to 0 (which means "finished") iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), KInProgressPropertyKey, 0 ); @@ -145,15 +150,23 @@ iBlacklist->AppendL(aPluginInfo.iImplementationUid); TAny* plug(NULL); TInt err(KErrNone); + CPSPERF( ("CHarvesterPluginValidator::LoadPluginL Uid: 0x%X - START", + aPluginInfo.iImplementationUid.iUid) ); TRAP( err, plug = REComSession::CreateImplementationL( aPluginInfo.iImplementationUid, aPluginInfo.iDtor_ID_Key, iParameter ) ); + CPSPERF( ("CHarvesterPluginValidator::LoadPluginL - DONE") ); if (err == KErrNone && plug) { TRAP_IGNORE( CleanupStack::PushL( plug ); aPluginInfo.iPlugin = plug; iPluginArray.AppendL( aPluginInfo ); + if( aPluginInfo.iImplementationUid.iUid + == KADatFactorySettingsServerPluginUid) + iUpdatePluginArray.Insert( aPluginInfo, 0); + else + iUpdatePluginArray.AppendL( aPluginInfo ); CleanupStack::Pop( plug ); ); } @@ -169,40 +182,33 @@ void CHarvesterPluginValidator::UpdatePluginsL() { // set property value to 1 (which means "in progress") - iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, 1); + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 1 ); CContentHarvesterPlugin* plugin = NULL; - CContentHarvesterPlugin* fsplugin = - static_cast (GetImplementation( - TUid::Uid(KADatFactorySettingsServerPluginUid))); - if (fsplugin) + while( iUpdatePluginArray.Count() ) { - iBlacklist->AppendL(TUid::Uid(KADatFactorySettingsServerPluginUid)); - TRAP_IGNORE( fsplugin->UpdateL() ); - iBlacklist->RemoveL(TUid::Uid(KADatFactorySettingsServerPluginUid)); - } - for (TInt i = 0; i < iPluginArray.Count(); i++) - { - plugin - = static_cast (iPluginArray[i].iPlugin); - if (plugin != fsplugin) - { - //first we append UID to the blacklist - iBlacklist->AppendL(iPluginArray[i].iImplementationUid); - TRAP_IGNORE( plugin->UpdateL() ); - //no panic during update so we can remove UID from blacklist - iBlacklist->RemoveL(iPluginArray[i].iImplementationUid); - } + plugin = static_cast ( iUpdatePluginArray[0].iPlugin ); + //first we append UID to the blacklist + iBlacklist->AppendL( iUpdatePluginArray[0].iImplementationUid ); + CPSPERF( ("CHarvesterPluginValidator::UpdatePluginsL Uid: 0x%X - START", + iUpdatePluginArray[0].iImplementationUid) ); + TRAP_IGNORE( plugin->UpdateL() ); + CPSPERF( ("CHarvesterPluginValidator::UpdatePluginsL - DONE") ); + //no panic during update so we can remove UID from blacklist + iBlacklist->RemoveL( iUpdatePluginArray[0].iImplementationUid ); + // plugin was updated correctly so we remove it from update plugin array + iUpdatePluginArray.Remove( 0 ); } // set property value to 0 (which means "finished") - iInProgressProperty.Set(TUid::Uid(KHarvesterUid), KInProgressPropertyKey, - 0); + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 0 ); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -// +// TInt CHarvesterPluginValidator::UpdateCallback( TAny* aValidator ) { if ( aValidator ) diff -r a5a39a295112 -r 8baec10861af contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -26,7 +26,7 @@ // // ---------------------------------------------------------------------------- // -EXPORT_C CPluginValidator* CPluginValidator::NewL( TUid aUid, +EXPORT_C CPluginValidator* CPluginValidator::NewL( TUid aUid, TAny *aParameter ) { CPluginValidator* self = CPluginValidator::NewLC( aUid , aParameter ); @@ -41,7 +41,7 @@ EXPORT_C CPluginValidator* CPluginValidator::NewLC( TUid aUid, TAny *aParameter ) { - CPluginValidator* self = new( ELeave ) CPluginValidator( aUid, + CPluginValidator* self = new( ELeave ) CPluginValidator( aUid, aParameter ); CleanupStack::PushL( self ); self->ConstructL(); @@ -56,8 +56,8 @@ { TPluginInfo pluginInfo; pluginInfo.iImplementationUid = aUid; - TInt index = iPluginArray.Find( pluginInfo, - TIdentityRelation< TPluginInfo >(UidMatch) ); + TInt index = iPluginArray.Find( pluginInfo, + TIdentityRelation< TPluginInfo >(UidMatch) ); return GetImplementation( index ); } @@ -67,12 +67,12 @@ // EXPORT_C TAny* CPluginValidator::GetImplementation( TInt aIndex ) { - TAny* ret( NULL ); + TAny* ret( NULL ); if (( aIndex != KErrNotFound ) && ( aIndex < iPluginArray.Count() )) - { - ret= iPluginArray[aIndex].iPlugin; - } - return ret; + { + ret= iPluginArray[aIndex].iPlugin; + } + return ret; } // ---------------------------------------------------------------------------- @@ -98,16 +98,16 @@ } REComSession::FinalClose( ); } - + // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // void CPluginValidator::RunL() { + iSession->NotifyOnChange( iStatus ); + SetActive(); ManagePluginsL(); - iSession->NotifyOnChange( iStatus ); - SetActive(); } // ---------------------------------------------------------------------------- @@ -131,12 +131,12 @@ // // ---------------------------------------------------------------------------- // -CPluginValidator::CPluginValidator( TUid aUid, TAny* aParameter ): +CPluginValidator::CPluginValidator( TUid aUid, TAny* aParameter ): CActive(EPriorityStandard), iUid( aUid ), iParameter( aParameter ) { - + } // ---------------------------------------------------------------------------- @@ -156,111 +156,110 @@ // // ---------------------------------------------------------------------------- // -TBool CPluginValidator::PresentInArrayL( TPluginInfo aPluginInfo, - const RImplInfoPtrArray& aInfoArray ) - { - TBool result(EFalse); - for ( TInt i = 0; i< aInfoArray.Count(); i++ ) - { - if ( aPluginInfo.iImplementationUid.iUid == - aInfoArray[i]->ImplementationUid().iUid) - { - result = ETrue; - break; - } - } - return result; - } - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -void CPluginValidator::DestroyPlugin( TInt aIndex ) +TBool CPluginValidator::PresentInArrayL( TPluginInfo aPluginInfo, + const RImplInfoPtrArray& aInfoArray ) { - CBase* plugin = static_cast( iPluginArray[aIndex].iPlugin ); - delete plugin; - REComSession::DestroyedImplementation( - iPluginArray[aIndex].iDtor_ID_Key ); + TBool result( EFalse ); + for( TInt i = 0; i < aInfoArray.Count(); i++ ) + { + if( aPluginInfo.iImplementationUid.iUid + == aInfoArray[i]->ImplementationUid().iUid ) + { + result = ETrue; + break; + } + } + return result; } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- -// -void CPluginValidator::CleanPluginsTable() +// +void CPluginValidator::DestroyPlugin( TInt aIndex ) { - for ( TInt i = 0; i < iPluginArray.Count(); i++ ) - { - DestroyPlugin( i ); - } + CBase* plugin = static_cast( iPluginArray[aIndex].iPlugin ); + delete plugin; + REComSession::DestroyedImplementation( + iPluginArray[aIndex].iDtor_ID_Key ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::CleanPluginsTable() + { + for( TInt i = 0; i < iPluginArray.Count(); i++ ) + { + DestroyPlugin( i ); + } } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CPluginValidator::ManagePluginsL() +void CPluginValidator::ManagePluginsL() { // Read info about all implementations into infoArray RImplInfoPtrArray infoArray; CleanupResetAndDestroyPushL( infoArray ); - + REComSession::ListImplementationsL( iUid , infoArray ); - TPluginInfo pluginInfo; + TPluginInfo pluginInfo; //Load new plugins for ( TInt i = 0; i < infoArray.Count( ); i++ ) { pluginInfo.iImplementationUid = infoArray[i]->ImplementationUid( ); pluginInfo.iVersion = infoArray[i]->Version(); - - TInt index = iPluginArray.Find( pluginInfo, - TIdentityRelation< TPluginInfo >(UidMatch) ); - - if ( index == KErrNotFound ) - { - //plugin wasn't present, we load it now - LoadPluginL( pluginInfo ); - } - else if ( pluginInfo.iVersion > iPluginArray[index].iVersion ) - { - //plugin was present but it is a newer version, - //remove old and load a new one - DestroyPlugin( index ); - iPluginArray.Remove( index ); - LoadPluginL( pluginInfo ); - } + + TInt index = iPluginArray.Find( pluginInfo, + TIdentityRelation< TPluginInfo >(UidMatch) ); + + if( index == KErrNotFound ) + { + //plugin wasn't present, we load it now + LoadPluginL( pluginInfo ); + } + else if( pluginInfo.iVersion > iPluginArray[index].iVersion ) + { + //plugin was present but it is a newer version, + //remove old and load a new one + DestroyPlugin( index ); + iPluginArray.Remove( index ); + LoadPluginL( pluginInfo ); + } } //Remove old plugins - for ( TInt i = iPluginArray.Count() - 1 ; i >= 0; i-- ) - { - pluginInfo = iPluginArray[i]; - if ( !PresentInArrayL( pluginInfo, infoArray ) ) - { - DestroyPlugin( i ); - iPluginArray.Remove( i ); - } - } - CleanupStack::PopAndDestroy( &infoArray ); + for( TInt i = iPluginArray.Count() - 1; i >= 0; i-- ) + { + pluginInfo = iPluginArray[i]; + if ( !PresentInArrayL( pluginInfo, infoArray ) ) + { + DestroyPlugin( i ); + iPluginArray.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &infoArray ); } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) +void CPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) { - TAny* plug ( NULL ); - TInt err( KErrNone ); - TRAP( err, plug = REComSession::CreateImplementationL( - aPluginInfo.iImplementationUid, - aPluginInfo.iDtor_ID_Key, iParameter ) ); - if( err==KErrNone && plug ) - { - CleanupStack::PushL( plug ); - aPluginInfo.iPlugin = plug; - iPluginArray.AppendL( aPluginInfo ); - CleanupStack::Pop( plug ); - } - } - + TAny* plug( NULL ); + TInt err( KErrNone ); + TRAP( err, plug = REComSession::CreateImplementationL( + aPluginInfo.iImplementationUid, + aPluginInfo.iDtor_ID_Key, iParameter ) ); + if( err == KErrNone && plug ) + { + CleanupStack::PushL( plug ); + aPluginInfo.iPlugin = plug; + iPluginArray.AppendL( aPluginInfo ); + CleanupStack::Pop( plug ); + } + } diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/conf/hsps.confml Binary file homescreenpluginsrv/conf/hsps.confml has changed diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/conf/hsps_200159c9.crml Binary file homescreenpluginsrv/conf/hsps_200159c9.crml has changed diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/conf/hsps_qhd.confml Binary file homescreenpluginsrv/conf/hsps_qhd.confml has changed diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/conf/hsps_vga.confml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/conf/hsps_vga.confml Tue Sep 14 21:55:16 2010 +0300 @@ -0,0 +1,44 @@ + + + + CenRep keys for Homescreenpluginsrv + + Holds UID of an active application configuration plugin for AI3 client + + + Holds UID of an active application configuration plugin for EUnit client + + + Holds device language ID from previous startup + + + FW version or empty if plugins should be reinstalled in next start up + + + Holds information whether configuration states must be checked + + + Access control for clients which are missing the capablities + + + + + 536999055 + 536916224 + 1 + + 0 + 0x102750F0;0x200159C6;0x20000FB1;0x10005A32;0x100058EC;0x200159c5;0x200255FF; + + + + + true + true + true + true + true + false + + + diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/group/bld.inf --- a/homescreenpluginsrv/group/bld.inf Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/group/bld.inf Tue Sep 14 21:55:16 2010 +0300 @@ -49,10 +49,14 @@ // Generic configuration interface for component cenrep settings -../conf/hsps.confml APP_LAYER_CONFML(hsps.confml) +#if defined(FF_LAYOUT_480_640_TOUCH_VGA4) || defined(FF_LAYOUT_640_480_TOUCH_VGA4) +../conf/hsps_vga.confml APP_LAYER_CONFML(hsps.confml) +#else +../conf/hsps_qhd.confml APP_LAYER_CONFML(hsps.confml) +#endif + ../conf/hsps_200159c9.crml APP_LAYER_CRML(hsps_200159c9.crml) - // Exports for SAPI impl ../inc/hspsdomattribute.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomattribute.h) ../inc/mhspsdomlistitem.h MW_LAYER_PLATFORM_EXPORT_PATH(mhspsdomlistitem.h) diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/inc/hspsconfiguration.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsconfiguration.h Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsconfiguration.h Tue Sep 14 21:55:16 2010 +0300 @@ -54,7 +54,7 @@ // Options for the KConfigurationAttrLocking _LIT8( KConfLockingLocked, "locked" ); // Locked state -_LIT8( KConfLockingRemovable, "removable" ); // Removable state +_LIT8( KConfLockingPermanent, "permanent" ); // Permanent state (not removable, not movable) _LIT8( KConfLockingNone, "none" ); // Default // Control element diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Tue Sep 14 21:55:16 2010 +0300 @@ -585,6 +585,11 @@ void AddLocalesL( const TDesC& aPath, const TBool aProcessOnlyDTD ); + + void DoAddLocalesL( + const TDesC& aPath, + const TLanguage aLanguage, + const TBool aProcessOnlyDTD ); /** * Adds localized dtd resources from the provided subdirectory diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Tue Sep 14 21:55:16 2010 +0300 @@ -725,6 +725,16 @@ ChspsODT& aOdt ); /** + * Activates default configuration defined for the application + * @since S60 5.2 + * @param aHeader application which default configuration is activated + * @param aOdt activated application configuration + */ + void ActivateDefaultAppConfL( + const ChspsODT& aHeader, + ChspsODT& aOdt ); + + /** * HandleDefinitionRespositoryEventL * * @since S60 5.0 @@ -742,6 +752,28 @@ RArray& aNotificationParams); /** + * RemoveAppConfFromRepositoryL + * Removes application confguration from definition repository + * @since S60 5.2 + * @param aOdt application configuration to be removed + * @param aNotificationParams notifications need to be sent after removal + */ + void RemoveAppConfFromRepositoryL( + const ChspsODT& aOdt, + RArray& aNotificationParams ); + + /** + * RemovePluginConfFromRepositoryL + * Removes plugin confguration from definition repository + * @since S60 5.2 + * @param aOdt plugin configuration to be removed + * @param aNotificationParams notifications need to be sent after removal + */ + void RemovePluginConfFromRepositoryL( + const ChspsODT& aOdt, + RArray& aNotificationParams ); + + /** * InvalidateUninstalledPluginInstancesL * Removes uninstalled plugin instances from an inactive * application configuration by changing them to error state. diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Tue Sep 14 21:55:16 2010 +0300 @@ -390,14 +390,18 @@ /** * Checks resource files of defined configuration - * Function leaves if all resource files cannot be found + * Function changes resoure paths according to the current + * device language. + * Function leaves if all resource files cannot be found. * @since S60 5.0 - * @param aOdt is an instance of the ODT class - * @param aConfUid is configuration UID which resources are checked + * @param aOdt is the application configuration instance + * @param aPluginHeader is the plugin which should be checked + * @param aRfs is an existing file server session */ static void CheckResourceFilesL( - const ChspsODT& aOdt, - const TInt aConfUid ); + ChspsODT& aAppOdt, + const ChspsODT& aPluginHeader, + RFs& aRfs ); /** * Returns configuration's version string diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -741,7 +741,13 @@ } else { - error = KErrCorrupt; + // Child counts should match, set plugin to Error state + const TInt pluginUid = hspsServerUtil::GetPluginUid( parentNode ).iUid; + __ASSERT_DEBUG( pluginUid > 0, User::Leave( KErrCorrupt ) ); + AddErrorConfigurationL( + appDom, + *parentNode, + pluginUid ); } } else diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -395,12 +395,22 @@ TRAPD( err, DoInstallThemeL(aManifestFileName) ); if( !err ) { - // correct headerdata is in iHeaderData set by CheckHeaderL() - aHeaderData = iHeaderData->Des(); - - // Set next phase - iInstallationPhase = EhspsPhaseCleanup; - ret = EhspsInstallThemeSuccess; + // correct headerdata is in iHeaderData set by CheckHeaderL(), check space + const TUint bytesRequired = iHeaderData->Des().Length(); + const TUint bytesAllocated = aHeaderData.MaxLength(); + if( bytesRequired <= bytesAllocated ) + { + aHeaderData = iHeaderData->Des(); + + // Set next phase + iInstallationPhase = EhspsPhaseCleanup; + ret = EhspsInstallThemeSuccess; + } + else + { + err = KErrOverflow; + iInstallationPhase = EhspsPhaseIdle; + } } else { @@ -1588,8 +1598,8 @@ KNullDesC(), (TLanguage)( fullODT->OdtLanguage() ) ); - notifications.Append( info ); - } + notifications.AppendL( info ); + } CleanupStack::PopAndDestroy(); // pluginIds. CleanupStack::PopAndDestroy( fullODT ); @@ -2260,11 +2270,11 @@ TInt drive = hspsServerUtil::GetEmmcDrivePath( iFsSession ); if ( drive != KErrNotFound ) { - driveArray.Append( drive ); + driveArray.AppendL( drive ); } - driveArray.Append( EDriveC ); - driveArray.Append( EDriveZ ); + driveArray.AppendL( EDriveC ); + driveArray.AppendL( EDriveZ ); FindResourceFilesL( aPath, ETrue, driveArray, systemEpocLanguageCodes ); @@ -2281,12 +2291,7 @@ void ChspsInstallationHandler::AddLocalesL( const TDesC& aPath, const TBool aProcessOnlyDTD ) - { - // Retrieve phone supported language. - CArrayFixFlat* languageCodes = NULL; - hspsServerUtil::GetInstalledLanguagesL( languageCodes ); - CleanupStack::PushL( languageCodes ); - + { // Ensure that path contains '\' at the end. TFileName pathBase; pathBase.Copy( aPath ); @@ -2299,20 +2304,50 @@ pathBase.Append( KPathDelim ); } } - - TParsePtrC driveParser( pathBase ); - TInt driveEnum = KErrNotFound; + +#if defined(WINSCW) || defined(__WINS__) - if( !aProcessOnlyDTD ) + // Emulator environment supports all languages, include all directories + CDir* dir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.SetFindMask( KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted ); + fileFinder.FindWildByPath( aPath, NULL, dir ); + if ( dir ) { - if( driveParser.DrivePresent() && driveParser.Drive().Length() > 0 ) + CleanupStack::PushL( dir ); + + for ( TInt i=0; i < dir->Count(); i++ ) { - User::LeaveIfError( - RFs::CharToDrive( ( driveParser.Drive() )[0], - driveEnum ) ); - } + const TEntry& dirEntry = (*dir)[i]; + if ( dirEntry.IsDir() ) + { + TInt languageId = KErrNotFound; + TLex lex( dirEntry.iName ); + if( lex.Val( languageId ) == KErrNone ) + { + TPath path( aPath ); + path.Append( dirEntry.iName ); + path.Append( KPathDelim ); + + DoAddLocalesL( + path, + (TLanguage)languageId, + aProcessOnlyDTD ); + } + } + } + CleanupStack::PopAndDestroy( dir ); } +#else + + // Devices have less languages, therefore include specific directories only + CArrayFixFlat* languageCodes = NULL; + hspsServerUtil::GetInstalledLanguagesL( languageCodes ); + CleanupStack::PushL( languageCodes ); + + TParsePtrC driveParser( pathBase ); + _LIT( KFormatNN, "%02d" ); TFileName localePath; @@ -2356,38 +2391,57 @@ } if( exists ) - { - // If we found the first language specification - if ( !iDefaultSpecificationSet ) - { - // Assume this is the default language shown incase - // there is no locale for the active UI language - iDefaultSpecification = (TLanguage)languageCode; - iDefaultSpecificationSet = ETrue; - } - - // Add dtd file if existing. - AddDtdFileL( localePath, (TLanguage)languageCode ); - - if( !aProcessOnlyDTD ) - { - // Find localized files from the provided directory - RArray driveArray; - CleanupClosePushL( driveArray ); - driveArray.Append( driveEnum ); - - FindResourceFilesL( localePath, - EFalse, - driveArray, - NULL ); - - CleanupStack::PopAndDestroy(); // driveArray - } + { + DoAddLocalesL( + localePath, + (TLanguage)languageCode, + aProcessOnlyDTD ); } } CleanupStack::PopAndDestroy( languageCodes ); languageCodes = NULL; +#endif + } + +void ChspsInstallationHandler::DoAddLocalesL( + const TDesC& aPath, + const TLanguage aLanguage, + const TBool aProcessOnlyDTD ) + { + // If we found the first language specification + if ( !iDefaultSpecificationSet ) + { + // Assume this is the default language shown incase + // there is no locale for the active UI language + iDefaultSpecification = aLanguage; + iDefaultSpecificationSet = ETrue; + } + + // Add DTD files holding localized widget name and desc + AddDtdFileL( aPath, aLanguage ); + + if( !aProcessOnlyDTD ) + { + TParsePtrC driveParser( aPath ); + TInt driveEnum = KErrNotFound; + if( driveParser.DrivePresent() && driveParser.Drive().Length() > 0 ) + { + User::LeaveIfError( RFs::CharToDrive( ( driveParser.Drive() )[0], driveEnum ) ); + } + + // Find localized resources from the subdirectory + RArray driveArray; + CleanupClosePushL( driveArray ); + driveArray.AppendL( driveEnum ); + + FindResourceFilesL( aPath, + EFalse, + driveArray, + NULL ); + + CleanupStack::PopAndDestroy(); // driveArray + } } // ----------------------------------------------------------------------------- diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -319,6 +319,7 @@ CleanupStack::PopAndDestroy(headerdata); ThspsRepositoryInfo info( EhspsODTActivated ); + info.iAppUid = odt->RootUid(); iDefinitionRepository.RegisterNotification( info ); } } @@ -1865,7 +1866,7 @@ TInt pluginCount = pluginsNode->ChildNodes().Length(); for( TInt pluginIndex=0; pluginIndex < pluginCount; pluginIndex++ ) { - nodeArray.Append( (ChspsDomNode*)pluginsNode->ChildNodes().Item( pluginIndex ) ); + nodeArray.AppendL( (ChspsDomNode*)pluginsNode->ChildNodes().Item( pluginIndex ) ); } // Remove the nodes and related resources @@ -3209,7 +3210,8 @@ if( !( aSetMask.Flags() & EhspsThemeStatusLicenceeDefault ) ) { RArray notifParams; - + CleanupClosePushL( notifParams ); + if( !iDefinitionRepository.Locked() ) { iDefinitionRepository.Lock(); @@ -3221,14 +3223,11 @@ TInt error( KErrNone ); if ( aSetMask.ConfigurationType() != EhspsAppConfiguration ) { - // Fix plugin instances and get notifications from valid cases - TRAP( error, RemovePluginFromAppConfsL( aSetMask, notifParams ) ); + TRAP( error, RemovePluginConfFromRepositoryL( aSetMask, notifParams ) ); } - - if( !error ) + else { - // Remove the actual plugin from file system - TRAP( error, RemoveThemeL( aSetMask ) ); + TRAP( error, RemoveAppConfFromRepositoryL( aSetMask, notifParams ) ); } if( !error ) @@ -3257,7 +3256,7 @@ } } - notifParams.Close(); + CleanupStack::PopAndDestroy( ¬ifParams ); } return ret; @@ -3272,7 +3271,7 @@ RArray& aNotificationParams ) { __ASSERT_DEBUG( aOdt.ThemeUid(), User::Leave( KErrArgument ) ); - + // Loop application configurations const TInt count = iHeaderListCache.Count(); for ( TInt i = 0; i < count; i++ ) @@ -3360,7 +3359,7 @@ lastNotification, aOdt.ThemeFullName(), (TLanguage)( aOdt.OdtLanguage() ) ); - aNotificationParams.Append(info); + aNotificationParams.AppendL(info); } #ifdef HSPS_LOG_ACTIVE if( iLogBus ) @@ -3390,18 +3389,59 @@ ETrue, aOdt.ThemeFullName(), (TLanguage)( aOdt.OdtLanguage() ) ); - aNotificationParams.Append(info); + aNotificationParams.AppendL(info); } } - pluginIds.Close(); CleanupStack::PopAndDestroy( 2, appOdt ); // appOdt, pluginIds appOdt = NULL; } // app configuration } // header loop - + } + +// ----------------------------------------------------------------------------- +// RemoveAppConfFromRepositoryL +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RemoveAppConfFromRepositoryL( + const ChspsODT& aOdt, + RArray& /* aNotificationParams */ ) + { + __ASSERT_DEBUG( aOdt.ThemeUid(), User::Leave( KErrArgument ) ); + + ChspsODT* activeAppConf = ChspsODT::NewL(); + CleanupStack::PushL( activeAppConf ); + iThemeServer.GetActivateAppConfigurationL( aOdt.RootUid(), *activeAppConf ); + if ( aOdt.ThemeUid() == activeAppConf->ThemeUid() ) + { + // Active application configuration removed + ActivateDefaultAppConfL( aOdt, *activeAppConf ); + } + + CleanupStack::PopAndDestroy( activeAppConf ); + + // Remove the actual application configuration from file system + RemoveThemeL( aOdt ); + + } + +// ----------------------------------------------------------------------------- +// RemovePluginConfFromRepositoryL +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RemovePluginConfFromRepositoryL( + const ChspsODT& aOdt, + RArray& aNotificationParams ) + { + __ASSERT_DEBUG( aOdt.ThemeUid(), User::Leave( KErrArgument ) ); + + // Fix plugin instances and get notifications from valid cases + RemovePluginFromAppConfsL( aOdt, aNotificationParams ); + + // Remove the actual plugin configuration from file system + RemoveThemeL( aOdt ); } // ----------------------------------------------------------------------------- @@ -3515,7 +3555,8 @@ User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); RArray notifParams; - + CleanupClosePushL( notifParams ); + TRAP( errorCode, UpdatePluginFromAppConfsL( *odt, notifParams )); if( errorCode ) @@ -3540,8 +3581,8 @@ } } - notifParams.Close(); + CleanupStack::PopAndDestroy( ¬ifParams ); CleanupStack::PopAndDestroy( odt ); } @@ -3617,7 +3658,7 @@ status, aOdt.ThemeFullName(), (TLanguage)( aOdt.OdtLanguage() ) ); - aNotificationParams.Append(info); + aNotificationParams.AppendL(info); } } @@ -3625,7 +3666,6 @@ CleanupStack::PopAndDestroy( odt ); } } - } } // ----------------------------------------------------------------------------- @@ -4507,28 +4547,8 @@ // If active application configuration is not "LicenceeRestorable" if ( !(aHeader->Flags() & EhspsThemeStatusLicenceeRestorable) ) { - // Try to activate a configuation with the LicenceeRestorable status - ChspsODT* searchMask = ChspsODT::NewL(); - CleanupStack::PushL( searchMask ); - searchMask->SetRootUid( aHeader->RootUid() ); - searchMask->SetFamily( aHeader->Family() ); - searchMask->SetFlags( EhspsThemeStatusLicenceeRestorable ); - TInt pos( 0 ); - iThemeServer.GetConfigurationHeader( *searchMask, aHeader, pos ); - if ( aHeader ) - { - // Activate licensee restorable configuration - iThemeServer.ActivateThemeL( *aHeader, aOdt ); - ThspsRepositoryInfo info( EhspsODTActivated ); - iDefinitionRepository.RegisterNotification( info ); - } - else - { - // Licensee restorable configuration not found. There must be - // at least one licensee restorable configuration per application - User::Leave( KErrNotFound ); - } - CleanupStack::PopAndDestroy( searchMask ); + // Try to activate default configuation + ActivateDefaultAppConfL( *aHeader, aOdt ); } else { @@ -4538,6 +4558,39 @@ } // ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ActivateDefaultAppConfL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ActivateDefaultAppConfL( + const ChspsODT& aHeader, + ChspsODT& aOdt ) + { + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( aHeader.RootUid() ); + searchMask->SetFamily( aHeader.Family() ); + searchMask->SetFlags( EhspsThemeStatusLicenceeRestorable ); + + ChspsODT* defaultAppConf( NULL ); + TInt pos( 0 ); + iThemeServer.GetConfigurationHeader( *searchMask, defaultAppConf, pos ); + if ( defaultAppConf ) + { + // Activate licensee restorable configuration + iThemeServer.ActivateThemeL( *defaultAppConf, aOdt ); + } + else + { + // Licensee restorable configuration not found. There must be + // at least one licensee restorable configuration per application + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( searchMask ); + } + +// ----------------------------------------------------------------------------- // ChspsMaintenanceHandler::AddErrorConfigurationL() // ----------------------------------------------------------------------------- // @@ -4841,8 +4894,12 @@ ChspsDomAttribute* attr = static_cast( attrList.FindByName( KConfigurationAttrLocking ) ); if( attr ) - { - isLocked = ( attr->Value().CompareF( KConfLockingLocked ) == 0 ); + { + if( attr->Value().CompareF( KConfLockingLocked ) == 0 || + attr->Value().CompareF( KConfLockingPermanent ) == 0 ) + { + isLocked = ETrue; + } } return isLocked; @@ -4906,7 +4963,7 @@ if( !isLocked || foundLocked ) { // Mark for removal - nodeArray.Append( pluginNode ); + nodeArray.AppendL( pluginNode ); } else { diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -35,6 +35,7 @@ _LIT(KHspsFolder, "\\200159c0\\themes\\" ); _LIT(KSourcesFolder, "\\sources\\"); +_LIT(KLocalesFolder, "\\locales\\"); _LIT( KThemesFolder, "\\themes\\" ); _LIT( KDoubleBackSlash, "\\" ); _LIT8( KHexPrefix8, "0x" ); @@ -950,8 +951,10 @@ void hspsServerUtil::FindUniquePluginsL( ChspsODT& aOdt, RArray& aPluginArray ) - { - aPluginArray.Reset(); + { + aPluginArray.Reset(); + CleanupClosePushL( aPluginArray ); + ChspsDomDocument& dom = aOdt.DomDocument(); ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); CleanupStack::PushL( iter ); @@ -959,32 +962,32 @@ ChspsDomNode* node = iter->First(); ChspsDomNode* prevNode = NULL; while( node && prevNode != node ) - { - const TDesC8& name = node->Name(); + { + const TDesC8& name = node->Name(); - // Plugin element was found - if ( name == KPluginElement ) - { - ChspsDomList& attrList = node->AttributeList(); - ChspsDomAttribute* uidAttr = static_cast( attrList.FindByName(KPluginAttrUid) ); - if ( uidAttr ) - { - // Convert from hex to int - const TUid pluginUid = ConvertDescIntoUid( uidAttr->Value() ); - if ( pluginUid.iUid > 0 ) - { - TBool isUnique = ETrue; - for( TInt i=0; isUnique && iAttributeList(); + ChspsDomAttribute* uidAttr = static_cast( attrList.FindByName(KPluginAttrUid) ); + if ( uidAttr ) + { + // Convert from hex to int + const TUid pluginUid = ConvertDescIntoUid( uidAttr->Value() ); + if ( pluginUid.iUid > 0 ) + { + TBool isUnique = ETrue; + for( TInt i=0; isUnique && iNextL(); } - CleanupStack::PopAndDestroy( iter ); -} + + CleanupStack::PopAndDestroy( iter ); + CleanupStack::Pop( &aPluginArray ); + } //---------------------------------------------------------------------------- // CHspsServiceUtilities::HexString2Uint @@ -1275,10 +1280,9 @@ TFileName file; file.Append( aDirName ); file.Append( fileEntry.iName ); - aFiles.Append( file ); + aFiles.AppendL( file ); } CleanupStack::PopAndDestroy( fileList ); - CleanupStack::PopAndDestroy(); // fs } @@ -1410,41 +1414,93 @@ // ----------------------------------------------------------------------------- // void hspsServerUtil::CheckResourceFilesL( - const ChspsODT& aOdt, - const TInt aConfUid ) + ChspsODT& aAppOdt, + const ChspsODT& aPluginHeader, + RFs& aRfs ) { __UHEAP_MARK; - - // Convert configuration UID to decimal string - TBuf<10> confUid; - _LIT( KFormat, "%D" ); - confUid.AppendFormat( KFormat, aConfUid ); - - RFs fs; - CleanupClosePushL( fs ); - User::LeaveIfError( fs.Connect() ); + + // Get all languages which the HW image supports + CArrayFixFlat* supportedLanguages = NULL; + hspsServerUtil::GetInstalledLanguagesL( supportedLanguages ); + CleanupStack::PushL( supportedLanguages ); + supportedLanguages->InsertL( 0, ELangNone ); // language independent resources + const TInt languagesCount = supportedLanguages->Count(); - TInt resCount = aOdt.ResourceCount(); - for ( TInt i = 0; i < resCount; i++ ) - { - // Check if resource file belongs to defined configuration - // (file path contains configuration UID string) - ChspsResource& res = aOdt.ResourceL( i ); - TPtrC resFile = res.FileName(); - if ( resFile.FindC( confUid ) != KErrNotFound ) + // If set, the plug-in resources need to be updated + TBool isBroken = EFalse; + + // Loop resources from the application configuration and + // fix the language specific resources. + // Use case: backup has been taken from another variant + const TInt count = aAppOdt.ResourceCount(); + for ( TInt i = 0; i < count; i++ ) + { + ChspsResource& appResource = aAppOdt.ResourceL( i ); + + // If this resource needs to be checked + if ( appResource.ConfigurationUid() == aPluginHeader.ThemeUid() ) { - // Check that resource files exists - if ( !BaflUtils::FileExists( fs, resFile ) ) + // Test if localization matches + TBool wasFound = EFalse; + for( TInt j=0; j < languagesCount; j++ ) { - User::Leave( KErrNotFound ); + if( appResource.Language() == supportedLanguages->At( j ) ) + { + wasFound = ETrue; + break; + } + } + if( !wasFound ) + { + isBroken = ETrue; + break; } } } + + if( isBroken ) + { + // Remove all resources + RemovePluginResourcesL( aAppOdt, aPluginHeader.ThemeUid() ); + + // Add back the matching resources + const TInt resourceCount = aPluginHeader.ResourceCount(); + for ( TInt i=0; i < resourceCount; i++ ) + { + ChspsResource& resource = aPluginHeader.ResourceL( i ); + + // Ignore the ODT resource + if ( resource.FileName().FindF( KSourcesFolder ) > 0 + || resource.FileName().FindF( KLocalesFolder ) > 0 ) + { + + // Find valid resources + for( TInt j=0; j < languagesCount; j++ ) + { + if( resource.Language() == supportedLanguages->At( j ) ) + { + // Make sure the file exists + if( !BaflUtils::FileExists( aRfs, resource.FileName() ) ) + { + User::Leave( KErrNotFound ); + } + // Finally append the resource array of the application configuration + ChspsResource* clonedResource = resource.CloneL(); + CleanupStack::PushL( clonedResource ); + aAppOdt.AddResourceL( clonedResource ); + CleanupStack::Pop( clonedResource ); + } + } + + } + } + + } - CleanupStack::PopAndDestroy(); // fs + CleanupStack::PopAndDestroy( supportedLanguages ); __UHEAP_MARKEND; - } // ----------------------------------------------------------------------------- @@ -1992,6 +2048,13 @@ { aFs.SetSessionToPrivate( drive ); } +// When Emmc drive is not present in emulator it is replaced by D drive +#ifdef __WINSCW__ + else + { + aFs.SetSessionToPrivate( EDriveD ); + } +#endif } else { @@ -2102,6 +2165,7 @@ { CleanupStack::PushL( dirList ); + // Loop entries const TInt count = dirList->Count(); for( TInt entryIndex = 0; entryIndex < count; entryIndex++ ) { @@ -2111,12 +2175,18 @@ file.Append( entry.iName ); if( entry.IsDir() ) - { + { + if( aDeviceLanguages ) { +#if defined(WINSCW) || defined(__WINS__) + // Emulator environment supports all languages, include all directories +#else + // Devices have less languages, therefore include specific directories only TInt dirLanguage = 0; TLex lex( entry.iName ); - TBool skipDir = ETrue; + TBool skipDir = ETrue; + // If conversion succeeded if( lex.Val( dirLanguage ) == KErrNone && dirLanguage >= ELangTest ) { for( TInt i=0; i < aDeviceLanguages->Count(); i++ ) @@ -2129,26 +2199,30 @@ } } } + + // If the language is not supported by the device if( skipDir ) { continue; } +#endif } - - file.Append( KDoubleBackSlash ); - } + + file.Append( KDoubleBackSlash ); + } if( entry.IsDir() && aRecursive ) { - // Find files from the directory and drive + // Find files from the subdirectory and the drive RArray driveArray; CleanupClosePushL( driveArray ); - driveArray.Append( aDriveArray[driveIndex] ); + driveArray.AppendL( aDriveArray[driveIndex] ); FindResourcesL( aFs, driveArray, file, aFileArray, NULL ); CleanupStack::PopAndDestroy( &driveArray ); } else - { + { + // Append the results array HBufC* nameBuf = file.AllocLC(); aFileArray.AppendL( nameBuf ); CleanupStack::Pop( nameBuf ); @@ -2170,13 +2244,13 @@ { User::LeaveIfError( SysLangUtil::GetInstalledLanguages( aLanguages ) ); CleanupStack::PushL( aLanguages ); - - const TInt testLang = (TInt)ELangTest; - + + // Check for a duplicate entry + const TInt KTestLang = (TInt)ELangTest; TBool isIncluded = EFalse; for( TInt i = 0; i < aLanguages->Count(); i++ ) { - if( aLanguages->At( i ) == testLang ) + if( aLanguages->At( i ) == KTestLang ) { isIncluded = ETrue; break; @@ -2185,7 +2259,7 @@ if( !isIncluded ) { - aLanguages->InsertL( 0, testLang ); + aLanguages->InsertL( 0, KTestLang ); } CleanupStack::Pop( aLanguages ); diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -624,7 +624,8 @@ if( aRepositoryInfo.iEventType & EhspsODTUpdated || aRepositoryInfo.iEventType & EhspsODTModified || - aRepositoryInfo.iEventType & EhspsPluginReplaced ) + aRepositoryInfo.iEventType & EhspsPluginReplaced || + aRepositoryInfo.iEventType == EhspsODTActivated ) { SetResourceFileCopyRequired( aRepositoryInfo.iAppUid ); } @@ -3380,10 +3381,20 @@ header->ThemeVersion() ) ); if ( err == KErrNone ) { - // Check that configuration resource files are found - TRAP( err, hspsServerUtil::CheckResourceFilesL( - aOdt, - uids[ i ] ) ); + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + err = GetConfigurationL( 0, header->ThemeUid(), *odt ); + if ( err == KErrNone ) + { + // Check that configuration resource files are found + TRAP( err, + hspsServerUtil::CheckResourceFilesL( + aOdt, + *odt, + iFsSession ); + ); + } + CleanupStack::PopAndDestroy(); } } @@ -3632,7 +3643,7 @@ } if ( !alreadyIncluded ) { - notificationTargets.Append( header ); + notificationTargets.AppendL( header ); // Check if active configuration supports the current family TBool updateRequired = ETrue; diff -r a5a39a295112 -r 8baec10861af homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -781,7 +781,7 @@ ChspsODT& aAppODT, RArray& aUidArray ) { - aUidArray.Reset(); + aUidArray.Reset(); const TInt resourceCount = aAppODT.ResourceCount(); for( TInt resourceIndex = 0; resourceIndex < resourceCount; resourceIndex++ ) { @@ -790,9 +790,9 @@ if ( uid > 0 && aUidArray.Find( uid ) == KErrNotFound ) { - aUidArray.Append( uid ); + aUidArray.AppendL( uid ); } - } + } } // ----------------------------------------------------------------------------- diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h --- a/homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h Tue Sep 14 21:55:16 2010 +0300 @@ -128,4 +128,9 @@ */ const TUint32 KAIActiveViewPluginId = 0x00000852; +/** + * Key id for finger follow view switching support + */ +const TUint32 KAIFingerFollowSupport = 0x00000853; + #endif // __AI2INTERNALCRKEYS_H__ diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -27,7 +27,6 @@ HsWidgetItem::HsWidgetItem(std::string& aItemName, std::string& aValue): mItemName(aItemName), mItemString(aValue), mItemInt(0), mIsString(true),mTrigger(false) - { } @@ -36,7 +35,8 @@ // --------------------------------------------------------------------------- // HsWidgetItem::HsWidgetItem( std::string& aItemName, int aValue ): - mItemName(aItemName), mItemString(), mItemInt(aValue), mIsString(false) + mItemName(aItemName), mItemString(), mItemInt(aValue), + mIsString(false), mTrigger(false) { } diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApiBlocks.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApiBlocks.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApiBlocks.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -630,7 +630,7 @@ delete mHSPApi; - if ( count != 1 ) + if ( count != 4 ) { err = KErrGeneral; } @@ -724,7 +724,7 @@ CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); TInt count = ExtractItemCountL( *res ); - if ( count != 1 ) + if ( count != 4 ) { err = KErrGeneral; } @@ -770,7 +770,7 @@ CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); TInt count = ExtractItemCountL( *res ); - if ( count != 1 ) + if ( count != 4 ) { err = KErrGeneral; } @@ -816,7 +816,7 @@ CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); TInt count = ExtractItemCountL( *res ); - if ( count != 1 ) + if ( count != 4 ) { err = KErrGeneral; } diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsconfigurationservice.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsconfigurationservice.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsconfigurationservice.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -422,7 +422,7 @@ for(TInt i=0; i < iNotifyParams->iCount; i++ ) { - iPluginIds.Append( aParams.iPluginIds[i] ); + iPluginIds.AppendL( aParams.iPluginIds[i] ); } iNotifyParams->SetNameL(aParams.Name()); diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -1057,7 +1057,7 @@ } if ( aItemMask & CHspsLiwUtilities::EPluginMapLocked ) { - //Add plugin locked status - locked/removable/none(default) + //Add plugin locked status - locked/permanent/none(default) AppendAttributeToMapL( aMap, attrList, KConfigurationAttrLockingStatus, diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -61,5 +61,6 @@ LIBRARY hspsclient.lib LIBRARY hspsodt.lib LIBRARY hspsresult.lib +LIBRARY PlatformEnv.lib // for DriveInfo // End of file diff -r a5a39a295112 -r 8baec10861af homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -23,6 +23,7 @@ #include #include #include +#include #include "mt_hspsconfigurationif.h" #include "mt_hspsliwlistprinter.h" #include "mt_hspsinstallationservice.h" @@ -132,8 +133,38 @@ _LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg" ); _LIT( KFinnishMifLogo, "c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\dummy.mif" ); +const TInt16 KletterA = 'a'; // ASCII code for 'a' + // ======== LOCAL FUNCTIONS ==================================================== +//------------------------------------------------------------------------------ +// EMMC drive finder - from hspsServerUtil +//------------------------------------------------------------------------------ +TInt GetEmmcDrivePath( ) + { + RFs fs; + if ( fs.Connect() != KErrNone ) + { + return KErrNotFound; + } + TInt drive = KErrNotFound; + if ( DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultMassStorage, drive ) == KErrNone ) + { + TUint status; + if ( DriveInfo::GetDriveStatus( fs, drive, status ) == KErrNone ) + { + if ( status & DriveInfo::EDriveInternal ) + { + fs.Close(); + return drive; + } + } + } + fs.Close(); + return KErrNotFound; + } + // ======== MEMBER FUNCTIONS =================================================== //------------------------------------------------------------------------------ @@ -3209,6 +3240,15 @@ void MT_CHSPSConfigurationIf::Customization_1_L() { // Pre conditions + // There is minimal configuration and a D drive present in emulator + // Outcome: + // The original configuration file is bypassed by a new one placed on the D + // drive + // Possible problems: + // There is no E drive (EMMC) in emulator. The data are copied to the D + // drive. In case there is the E drive,please check all possible references + // to the D drive and change, if needed. This is important for HW testing. + // Remark: hspsServerUtil::FindFile() determines which drives are searched. EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); @@ -3219,13 +3259,24 @@ // Simulate customization by copying configuration files to D drive ("ROM" stuff is on C) CFileMan* fileManager = CFileMan::NewL( iFileserver ); CleanupStack::PushL( fileManager ); + + // Find MMC drive, if not found copy it to the D drive + TInt drive = GetEmmcDrivePath(); + if ( drive == KErrNotFound ) + { + drive = EDriveD; // Set D drive + } + _LIT( Kconfigdir, "d:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ); + TBuf<200> confdir; + confdir.Append( Kconfigdir ); + confdir[0] = ( TInt16 )drive + KletterA; // see ACII table User::LeaveIfError( fileManager->Copy( - _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration_customized.xml" ), - _L( "d:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ), - CFileMan::ERecurse|CFileMan::EOverWrite - ) + _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration_customized.xml" ), + confdir, + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + CleanupStack::PopAndDestroy( fileManager ); MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); diff -r a5a39a295112 -r 8baec10861af idlefw/conf/activeidle2.confml Binary file idlefw/conf/activeidle2.confml has changed diff -r a5a39a295112 -r 8baec10861af idlefw/conf/activeidle2_10275102.crml Binary file idlefw/conf/activeidle2_10275102.crml has changed diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/inc/aimcnpublisher.h --- a/idlefw/plugins/devicestatus/inc/aimcnpublisher.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/inc/aimcnpublisher.h Tue Sep 14 21:55:16 2010 +0300 @@ -98,6 +98,11 @@ * Own. */ CAiNetworkInfoListener* iListener; + + /** + * MCN info to show + */ + TNWMCNName iMCNName; }; diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp --- a/idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -194,7 +194,24 @@ TInt aContent, TInt aIndex ) { - return iObserver.Clean( aPlugin, aContent, aIndex ); + if ( IsInBlackList( aContent, aIndex ) ) + { + return KErrNotFound; + } + TInt err = iObserver.Clean( aPlugin, aContent, aIndex ); + // Publish went through OK, we need to commit the transaction + if ( err == KErrNone && iTransactionStarted ) + { + iCommitNeeded = ETrue; + } + // publish failed because the ui declaration doesn't + // include this content => add to black list and + // don't try to publish again + else if ( err == KErrNotFound || err == KErrNotSupported ) + { + AddToBlackList( aContent, aIndex ); + } + return err; } MAiContentObserver& CAiContentObserverOptimizer::Observer() const diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/aimcnpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aimcnpublisher.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/aimcnpublisher.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -71,7 +71,10 @@ void CAiMCNPublisher::RefreshL( TBool /*aClean*/ ) { - //cannot be refreshed + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentMCNIndicator, + iMCNName, + 0 ); } @@ -85,14 +88,15 @@ { if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) { - TPtrC msg = aInfo.iMCNName; + iMCNName.Copy( aInfo.iMCNName ); iContentObserver->Publish( *iExtension, EAiDeviceStatusContentMCNIndicator, - msg, + iMCNName, 0 ); } else if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeNone ) { + iMCNName.Copy( KNullDesC ); iContentObserver->Clean( *iExtension, EAiDeviceStatusContentMCNIndicator, 0 ); diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp --- a/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -100,36 +100,35 @@ void CAiNetworkInfoListener::AddObserverL( MAiNetworkInfoObserver& aObserver ) { - //Removing observer doesn't remove slots from array, removed observers are only - //set to NULL. Reason for this is found out later on the code. Adding observer - //first tries to find free slot, if it is not found, observer is appended to the - //array. - TInt freeSlot = iObservers.Find( NULL ); - - if( freeSlot == KErrNotFound ) + + if ( iObservers.Find( &aObserver ) == KErrNotFound) { - User::LeaveIfError( iObservers.Append( &aObserver ) ); + //Removing observer doesn't remove slots from array, removed observers are only + //set to NULL. Reason for this is found out later on the code. Adding observer + //first tries to find free slot, if it is not found, observer is appended to the + //array. + TInt freeSlot = iObservers.Find( NULL ); + + if( freeSlot == KErrNotFound ) + { + User::LeaveIfError( iObservers.Append( &aObserver ) ); + } + else + { + User::LeaveIfError( iObservers.Insert( &aObserver, freeSlot ) ); + } } - else - { - User::LeaveIfError( iObservers.Insert( &aObserver, freeSlot ) ); - } - } + } void CAiNetworkInfoListener::RemoveObserver( MAiNetworkInfoObserver& aObserver ) { - //Remove observer, removing is done by replacing it with NULL pointer. - const TInt count( iObservers.Count() ); - - for( TInt i( 0 ); i < count; i++ ) + TInt slot = iObservers.Find( &aObserver ); + + if (slot != KErrNotFound ) { - if( iObservers[i] == &aObserver ) - { - //replace it with NULL - iObservers.Remove( i ); - iObservers.Insert( NULL, i ); - break; - } + //Remove observer, removing is done by replacing it with NULL pointer. + iObservers.Remove( slot ); + iObservers.Insert( NULL, slot ); } } @@ -155,25 +154,45 @@ void CAiNetworkInfoListener::HandleNetworkMessage( const TNWMessages aMessage ) { - __PRINT(__DBG_FORMAT("XAI: Handle NW message %d"), aMessage ); + __PRINT(__DBG_FORMAT("XAI: CAiNetworkInfoListener > Handle NW message %d"), aMessage ); + + __PRINT(__DBG_FORMAT("XAI: iInfo.iRegistrationStatus %d"), iInfo.iRegistrationStatus ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iStatus %d"), iInfo.iStatus ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iCountryCode %S"), &iInfo.iCountryCode ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iNetworkId %S"), &iInfo.iNetworkId ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iOperatorNameInfo.iType %d"), iInfo.iOperatorNameInfo.iType ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iOperatorNameInfo.iName %S"), &iInfo.iOperatorNameInfo.iName ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iDisplayTag %S"), &iInfo.iDisplayTag ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iShortName %S"), &iInfo.iShortName ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iLongName %S"), &iInfo.iLongName ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iSPName %S"), &iInfo.iSPName ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iServiceProviderNameDisplayReq %d"), iInfo.iServiceProviderNameDisplayReq ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iNPName %S"), &iInfo.iNPName ); + __PRINT(__DBG_FORMAT("XAI: iInfo.iPLMNField %S"), &iInfo.iPLMNField ); + //Insert message into the message cache. Only one messsage of one type. TRAPD( err, iMessageCache->InsertIsqL( aMessage, iKeyProperties ) ); if( err == KErrAlreadyExists ) { + __PRINTS("XAI: message already exists in cache"); err = KErrNone; } if( err != KErrNone ) { + __PRINTS("XAI: error inserting message to cache , return"); return; } + __PRINTS("XAI: check if allowed to display operator indicator"); iShowOpInd = !NotAllowedToDisplayOperatorIndicator( aMessage ); TBool hasNetInfoChanged = HasNetworkInfoChanged( aMessage ); if ( !hasNetInfoChanged ) { + __PRINTS("XAI: net info not changed, return"); return; } + __PRINT(__DBG_FORMAT("XAI: Show operator indicator %d, info changed %d"), iShowOpInd, hasNetInfoChanged ); const TInt count( iObservers.Count() ); @@ -200,7 +219,7 @@ void CAiNetworkInfoListener::HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ) { - __PRINT(__DBG_FORMAT("XAI: Error code %d"), aErrorCode ); + __PRINT(__DBG_FORMAT("XAI: CAiNetworkInfoListener > NetworkError code %d"), aErrorCode ); TNWMessages errorCode = TNWMessages( KErrGeneral ); diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/ainwspublisher.cpp --- a/idlefw/plugins/devicestatus/src/ainwspublisher.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/ainwspublisher.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -41,6 +41,7 @@ void CAiNwsPublisher::ConstructL() { + __PRINTS( "XAI: CAiNwsPublisher > ConstructL" ); iListener = CAiNetworkInfoListener::InstanceL(); iProfileApi = CRepository::NewL( KCRUidProfileEngine ); } @@ -57,6 +58,7 @@ CAiNwsPublisher::~CAiNwsPublisher() { + __PRINTS( "XAI: CAiNwsPublisher > ~CAiNwsPublisher" ); if( iListener ) { iListener->RemoveObserver( *this ); @@ -68,6 +70,7 @@ void CAiNwsPublisher::ResumeL() { + __PRINTS( "XAI: CAiNwsPublisher > ResumeL" ); iListener->AddObserverL( *this ); } @@ -77,6 +80,7 @@ MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { + __PRINTS( "XAI: CAiNwsPublisher > Subscribe" ); iContentObserver = &aObserver; iExtension = &aExtension; } @@ -89,8 +93,10 @@ TBool CAiNwsPublisher::RefreshL( TInt aContentId, TBool aClean ) { + __PRINTS( "XAI: CAiNwsPublisher::RefreshL" ); if( aContentId == EAiDeviceStatusContentNWStatus ) { + __PRINTS( "XAI: content EAiDeviceStatusContentNWStatus" ); RefreshL( aClean ); return ETrue; } @@ -98,13 +104,12 @@ return EFalse; } - - void CAiNwsPublisher::HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& /*aMessage*/, const TNWInfo& aInfo, const TBool /*aShowOpInd*/ ) { + __PRINTS( "XAI: CAiNwsPublisher::HandleNetworkInfoChange" ); HandleStateChange( aInfo ); } @@ -139,16 +144,18 @@ void CAiNwsPublisher::HandleNetworkFound() { - __PRINTS( "XAI: Network found, clean state" ); + __PRINTS( "XAI: Network found" ); iRegistered = ETrue; if ( iContentObserver && iExtension ) { + __PRINTS( "XAI: Network found, clean state" ); iContentObserver->Clean( *iExtension, EAiDeviceStatusContentNWStatus, 0 ); } } void CAiNwsPublisher::HandleNetworkLost( const TNWNetworkSelectionSetting &aSelectionSetting ) { + __PRINTS( "XAI: Network lost" ); if( aSelectionSetting == ENWNetworkSelectionManual ) { // See if we were registered before diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp --- a/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -33,6 +33,7 @@ #include "aiprioritizer.h" #include "ainwidpriorities.h" #include "activeidle2domaincrkeys.h" +#include "debug.h" //Delay used to animate const TInt KCleanOperationDelay = 2 * 1000000; @@ -132,8 +133,10 @@ const TNWInfo& /*aInfo*/, const TBool aShowOpInd ) { + __PRINTS("XAI: CAiOperatorNamePublisher::HandleNetworkInfoChange"); if ( iSuspended ) { + __PRINTS("XAI: suspended"); return; } @@ -174,10 +177,12 @@ void CAiOperatorNamePublisher::RefreshL( TBool aClean ) { + __PRINTS("XAI: NamePublisher > RefreshL"); iSuccess = EFalse; if ( iSuspended ) { + __PRINTS("XAI: NamePublisher > RefreshL - iSuspended"); return; } @@ -185,6 +190,7 @@ { MProfile* profile = iProfileEngine->ActiveProfileLC(); const MProfileName& name = profile->ProfileName(); + iPriority = EAiOfflineProfile; iPrioritizer->TryToPublishL( *iBroadcaster, EAiDeviceStatusContentNetworkIdentity, name.Name(), @@ -193,14 +199,22 @@ CleanupStack::PopAndDestroy();//profile return; } - - if( aClean ) + else if ( iPriority == EAiOfflineProfile ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority ); + iPriority = EAiInvalidPriority; + } + else if( aClean ) { iPrioritizer->TryToCleanL( *iBroadcaster, EAiDeviceStatusContentNetworkIdentity, iPriority ); } - + + __PRINT(__DBG_FORMAT("XAI: NamePublisher > RefreshL - iPriority = %d"), iPriority ); + const TNWInfo& nwInfo = iListener->NetworkInfo(); #if defined(WINSCW) || defined(__WINS__) @@ -230,7 +244,8 @@ //Check if PLMN must be shown. const TBool showPLMN = nwInfo.iServiceProviderNameDisplayReq & ENWDisplayPLMNRequired; - + __PRINT(__DBG_FORMAT("XAI: NamePublisher > RefreshL - showPLMN = %d"), showPLMN ); + TBool isInSPDI = EFalse; TBool showSPN = EFalse; @@ -245,7 +260,8 @@ showSPN = showSPN || ( nwInfo.iServiceProviderNameDisplayReq & ENWDisplaySPNRequired ); - + + __PRINT(__DBG_FORMAT("XAI: NamePublisher > RefreshL - showSPN = %d"), showSPN ); #if defined(WINSCW) || defined(__WINS__) _LIT( KOperator, "Operator" ); @@ -278,8 +294,14 @@ } else { - //spn & plmn (SPN.And.EONS.No) - iPriority = EAiServiceProviderName; + __PRINTS("XAI: NamePublisher > RefreshL (showPLMN)- try publish and start delayed operation "); + //spn & plmn (SPN.And.EONS.No) + if ( !OperatorNamePriority( iPriority ) ) + { + iPriority = EAiServiceProviderName; + } + + __PRINT(__DBG_FORMAT("XAI: NamePublisher > RefreshL - try publish with priority %d"), iPriority ); iPrioritizer->TryToPublishL( *iBroadcaster, EAiDeviceStatusContentNetworkIdentity, serviceProviderName, @@ -322,8 +344,14 @@ } else { + __PRINTS("XAI: NamePublisher > RefreshL (showSPN)- try publish and start delayed operation "); //spn & plmn (SPN.And.EONS.No) - iPriority = EAiServiceProviderName; + if ( !OperatorNamePriority( iPriority ) ) + { + iPriority = EAiServiceProviderName; + } + + __PRINT(__DBG_FORMAT("XAI: NamePublisher > RefreshL - try publish with priority %d"), iPriority ); iPrioritizer->TryToPublishL( *iBroadcaster, EAiDeviceStatusContentNetworkIdentity, serviceProviderName, @@ -377,6 +405,7 @@ void CAiOperatorNamePublisher::ShowNetworkIdentityNameL( TBool aTryToPublish ) { + __PRINTS("XAI: NamePublisher > ShowNetworkIdentityNameL"); const TNWInfo& nwInfo = iListener->NetworkInfo(); iNetworkIdentityName.Set( KNullDesC ); @@ -388,6 +417,8 @@ nwInfo.iOperatorNameInfo.iType != RMmCustomAPI::EOperatorNameFlexiblePlmn && nwInfo.iRegistrationStatus == ENWRegisteredOnHomeNetwork ) { + __PRINTS("XAI: NamePublisher > ShowNetworkIdentityNameL - iNPName "); + //priority iPriority = EAiNetworkOperatorName; //name @@ -408,6 +439,8 @@ // *** Operator name *** if( nwInfo.iOperatorNameInfo.iName.Length() > 0 ) { + __PRINTS("XAI: NamePublisher > ShowNetworkIdentityNameL - iOperatorNameInfo.iName "); + //priority OperatorNamePriority( iPriority ); //name @@ -632,6 +665,7 @@ TInt CAiOperatorNamePublisher::CleanAndShowPLMNOperationCallback( TAny* aPtr ) { + __PRINTS("XAI: NamePublisher > CleanAndShowPLMNOperationCallback "); CAiOperatorNamePublisher* self = static_cast( aPtr ); @@ -657,14 +691,16 @@ void CAiOperatorNamePublisher::DoCleanOperationL() { + __PRINTS("XAI: NamePublisher > DoCleanOperationL"); iPrioritizer->TryToCleanL( *iBroadcaster, EAiDeviceStatusContentNetworkIdentity, - EAiServiceProviderName ); + iPriority ); } TBool CAiOperatorNamePublisher::RefreshL( TInt aContentId, TBool aClean ) { + __PRINTS("XAI: NamePublisher > RefreshL with content"); if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) { iSuspended = EFalse; @@ -682,6 +718,7 @@ TBool CAiOperatorNamePublisher::SuspendL( TInt aContentId, TBool /*aClean*/ ) { + __PRINTS("XAI: NamePublisher > SuspendL with content"); if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) { iSuspended = ETrue; @@ -696,8 +733,10 @@ TInt aContentId, TInt aPriority ) { + __PRINTS("XAI: NamePublisher > RefreshContentWithPriorityL"); if( aContentId == EAiDeviceStatusContentNetworkIdentity && aPriority == EAiServiceProviderName ) { + __PRINTS("XAI: NamePublisher > identity and priority matched "); RefreshL( EFalse ); if( iSuccess ) { diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp --- a/idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -54,14 +54,17 @@ TInt aResource, TInt aPriority ) { + __PRINT(__DBG_FORMAT("XAI: TryToPublishL - content %d, aResource %d, aPriority %d, iPriority %d"), aContent, aResource, aPriority, iPriority ); if( aPriority >= iPriority ) { + __PRINTS("XAI: prio publish - priority check ok"); iPriority = aPriority; (void)iContentObserver.Publish( iPropertyExtension, aContent, aResource, 0 ); } + __PRINTS("XAI: prio publish - done"); } @@ -70,7 +73,8 @@ const TDesC16& aText, TInt aPriority ) { - __PRINT(__DBG_FORMAT("XAI: prio publish - content %d, priority %d, text %S"), aContent, aPriority, &aText ); + __PRINTS("XAI: CAiPublishPrioritizer::TryToPublishL"); + __PRINT(__DBG_FORMAT("XAI: prio publish - content %d, aPriority %d, iPriority %d, text %S"), aContent, aPriority, iPriority, &aText ); if( aPriority >= iPriority ) { @@ -81,6 +85,11 @@ aText, 0 ); } + else + { + __PRINTS("XAI: prio publish - aPriority < iPriority !!!! "); + } + __PRINTS("XAI: prio publish - done"); } @@ -91,14 +100,23 @@ const TDesC8& aBuf, TInt aPriority ) { + __PRINTS("XAI: CAiPublishPrioritizer::TryToPublishL - TDesC8" ); if( aPriority >= iPriority ) { + __PRINTS("XAI: prio publish - priority check ok"); iPriority = aPriority; (void)iContentObserver.Publish( iPropertyExtension, aContent, aBuf, 0 ); } + else + { + __PRINTS("XAI: prio publish - aPriority < iPriority !!!! "); + } + + + __PRINTS("XAI: prio publish - done"); } @@ -106,7 +124,7 @@ TInt aContent, TInt aPriority ) { - __PRINT(__DBG_FORMAT("XAI: prio clean - content %d, priority %d"), aContent, aPriority ); + __PRINT(__DBG_FORMAT("XAI: CAiPublishPrioritizer::TryToCleanL - content %d, aPriority %d, iPriority %d"), aContent, aPriority, iPriority ); if( aPriority == EAiInvalidPriority ) { // do nothing @@ -138,4 +156,8 @@ } } } + else + { + __PRINT(__DBG_FORMAT("XAI: prio clean - CLEAN failed - iPriority %d"), iPriority ); + } } diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp --- a/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -30,6 +30,7 @@ #include #include #include +#include // User includes #include "mcsplugincompletedoperation.h" @@ -39,10 +40,13 @@ // Constants _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type. _LIT( KMenuAttrParamLogs, "logs:dialed" ); +_LIT( KMenuAttrProfiles, "profiles" ); /** Argument value for parameter*/ _LIT( KMenuAttrParam, "param" ); +const TUid KProfilesAppUid = { 0x100058F8 }; + #define KMCSCmailUidValue 0x2001E277 #define KMCSCmailMailboxDefaultViewIdValue 0x1 #define KMCSCmailMailboxViewIdValue 0x2 @@ -248,6 +252,27 @@ { LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() ); } + else if ( param.Find( KMenuAttrProfiles ) != KErrNotFound ) + { + RApaLsSession apaLsSession; + User::LeaveIfError( apaLsSession.Connect() ); + CleanupClosePushL( apaLsSession ); + + TApaAppInfo appInfo; + TInt retVal = apaLsSession.GetAppInfo( appInfo, KProfilesAppUid ); + + if ( retVal == KErrNone ) + { + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + User::LeaveIfError( apaLsSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + } + + CleanupStack::PopAndDestroy( &apaLsSession ); + } CleanupStack::PopAndDestroy( sendUi ); } diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Tue Sep 14 21:55:16 2010 +0300 @@ -62,7 +62,7 @@ /** * Name of the item. */ - TDesC& Name(); + const TDesC* Name(); /** * Set name of the item, @@ -72,7 +72,7 @@ /** * Value of the item. Used for bookmark url. */ - TDesC& Value(); + const TDesC* Value(); /* * Set value of the item. diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Tue Sep 14 21:55:16 2010 +0300 @@ -147,9 +147,12 @@ void SetBackupRestore( TBool aBackupRestore ); /** - * ShowSettingsL - */ - void ShowSettingsL(); + * Shows shortcut settings + * + * @param aEditIdx Change specified shortcut + * @return void + */ + void ShowSettingsL( const TInt aEditIdx ); private: // from MMCSPluginWatcherObserver diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -40,6 +40,7 @@ _LIT( KEventNameShowSettings, "ShowSettings" ); _LIT( KContentItemTypeText, "text" ); _LIT( KContentItemTypeImage, "image" ); +const TInt KUndefinedIndex = -1; const TImplementationProxy KImplementationTable[] = { @@ -375,7 +376,7 @@ } else if( aEventName == KEventNameShowSettings ) { - TRAP_IGNORE( iEngine->ShowSettingsL() ); + TRAP_IGNORE( iEngine->ShowSettingsL( KUndefinedIndex ) ); } } diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -111,9 +111,9 @@ // // --------------------------------------------------------------------------- // -TDesC& CMCSData::Name() +const TDesC* CMCSData::Name() { - return *iName; + return iName; } // --------------------------------------------------------------------------- @@ -131,9 +131,9 @@ // // --------------------------------------------------------------------------- // -TDesC& CMCSData::Value() +const TDesC* CMCSData::Value() { - return *iValue; + return iValue; } // --------------------------------------------------------------------------- @@ -265,20 +265,20 @@ // id of all bookmarks is zero so name has to be check // in case of bookmark has changed - if ( id >= 0 && ( data->MenuItem().Id() != id || - ( id == 0 && data->Name().CompareF( - iData[ i ]->Name() ) != 0 ) ) ) + if( data->MenuItem().Id() != id || + ( id == 0 && data->Name() != NULL && iData[i]->Name() != NULL && + data->Name()->CompareF( *iData[i]->Name() ) != 0 ) ) { data->SetDirty( ETrue ); CMCSData* oldData = iData[i]; iData.Remove( i ); delete oldData; - iData.InsertL( data, i ); - CleanupStack::Pop( data ); + CleanupStack::Pop( data ); } else { + // keep old data CleanupStack::PopAndDestroy( data ); } } @@ -572,8 +572,8 @@ } } } - // ETrue tells that modified settings are stored also to plugin reference - iPluginSettings->SetSettingsL( iInstanceUid, settingItems, ETrue ); + // EFalse tells that modified settings are not stored to plugin reference + iPluginSettings->SetSettingsL( iInstanceUid, settingItems, EFalse ); CleanupStack::PopAndDestroy(); // settingItems } diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -50,7 +50,6 @@ _LIT( KResourceFile, "mcspluginres.rsc" ); _LIT( KResPath, "\\resource\\" ); _LIT( KMMApplication, "mm://" ); -_LIT( KHideExit2, "&exit=hide" ); _LIT( KSetFocusString, "!setfocus?applicationgroup_name=" ); _LIT( KApplicationGroupName, "applicationgroup_name" ); _LIT( KIcon, "icon" ); @@ -62,6 +61,7 @@ _LIT( KMenuMailboxMaskId, "16389" ); _LIT( KMenuTypeMailbox, "menu:mailbox" ); _LIT( KPrefix, "0x" ); +_LIT( KMenuAttrInvokeSettingsUid, "0x99999990" ); const TUid KHomescreenUid = { AI_UID3_AIFW_COMMON }; const TUid KMMUid = { 0x101F4CD2 }; @@ -69,6 +69,10 @@ const TUid KMCSCmailMailboxViewIdValue = { 0x2 }; const TUid KBrowserUid = { 0x10008D39 }; +// maximum custom message length +const TInt KMaxCustomMsg = 256; +const TInt KUndefinedIndex = -1; + // ======== LOCAL FUNCTIONS ======== // ---------------------------------------------------------------------------- // NextIdToken @@ -355,7 +359,7 @@ { item = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 ); CleanupStack::PushL( item ); - item->SetAttributeL( KMenuAttrLongName, aData.Name() ); + item->SetAttributeL( KMenuAttrLongName, *aData.Name() ); item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); item->SetAttributeL( KMenuAttrIconId, KMenuBookmarkIconId ); item->SetAttributeL( KMenuAttrMaskId, KMenuBookmarkMaskId ); @@ -375,7 +379,7 @@ { item = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 ); CleanupStack::PushL( item ); - item->SetAttributeL( KMenuAttrLongName, aData.Name() ); + item->SetAttributeL( KMenuAttrLongName, *aData.Name() ); item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); item->SetAttributeL( KMenuAttrIconId, KMenuMailboxIconId ); item->SetAttributeL( KMenuAttrMaskId, KMenuMailboxMaskId ); @@ -403,7 +407,14 @@ TUint32 isHidden = flags & TMenuItem::EHidden; TUint32 isMissing = flags & TMenuItem::EMissing; - if ( iUndefinedItem && ( isHidden || isMissing ) ) + TBool attrExists = ETrue; + TPtrC uid = aMenuItem->GetAttributeL(KMenuAttrUid, attrExists); + + // if item is hidden or missing (mmc card removed) + // use "Undefined" icon instead + // for empty item it's own icon is shown + if ( iUndefinedItem && uid.Compare(KMenuAttrInvokeSettingsUid) != 0 && + ( isHidden || isMissing ) ) { menuItem = iUndefinedItem; } @@ -471,9 +482,14 @@ TUint32 isHidden = flags & TMenuItem::EHidden; TUint32 isMissing = flags & TMenuItem::EMissing; + TBool attrExists = ETrue; + TPtrC uid = aMenuItem->GetAttributeL(KMenuAttrUid, attrExists); + // if item is hidden or missing (mmc card removed) // use "Undefined" text instead - if ( iUndefinedItem && ( isHidden || isMissing ) ) + // for empty item it's own icon is shown + if ( iUndefinedItem && uid.Compare(KMenuAttrInvokeSettingsUid) != 0 && + ( isHidden || isMissing ) ) { menuItem = iUndefinedItem; } @@ -532,7 +548,23 @@ } else { - LaunchMCSItemL( dataItem ); + CMenuItem* item(CMenuItem::OpenL(iMenu, dataItem.MenuItem().Id())); + CleanupStack::PushL(item); + + TBool attrExists = ETrue; + + TPtrC uid = item->GetAttributeL(KMenuAttrUid, attrExists); + + // Show selected shortcut settings + if (uid.Compare(KMenuAttrInvokeSettingsUid) == 0) + { + TRAP_IGNORE( ShowSettingsL(aIndex + 1) ); + } + else + { + LaunchMCSItemL(dataItem); + } + CleanupStack::PopAndDestroy(item); } } @@ -567,18 +599,17 @@ if ( !hasApplicationGroupName ) { + CleanupStack::PopAndDestroy( item ); return; } message = HBufC8::NewLC( KMMApplication().Length() + KSetFocusString().Length() + - applicationGroupName.Length() + - KHideExit2().Length() ); + applicationGroupName.Length() ); message->Des().Copy( KMMApplication ); message->Des().Append( KSetFocusString ); message->Des().Append( applicationGroupName ); - message->Des().Append( KHideExit2 ); // find MM application TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); @@ -624,7 +655,7 @@ { StartEffect( KBrowserUid ); - CSchemeHandler* urlHandler = CSchemeHandler::NewL( aData.Value()); + CSchemeHandler* urlHandler = CSchemeHandler::NewL( *aData.Value()); CleanupStack::PushL( urlHandler ); urlHandler->HandleUrlStandaloneL(); CleanupStack::PopAndDestroy( urlHandler ); @@ -768,12 +799,22 @@ // Launch General Settings plugin // --------------------------------------------------------------------------- // -void CMCSPluginEngine::ShowSettingsL() +void CMCSPluginEngine::ShowSettingsL( const TInt aEditIdx ) { TUid uid = {AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN}; + // format the custom message + // iInstanceUid/aEditIdx is the format + TBuf8 msg; + msg.Append(iInstanceUid); + if( aEditIdx != KUndefinedIndex ) + { + msg.Append('//'); + msg.AppendFormat(_L8("%d"), aEditIdx); + } + CGSLauncher* launcher = CGSLauncher::NewLC(); - launcher->LaunchGSViewL ( uid, KHomescreenUid, iInstanceUid ); + launcher->LaunchGSViewL ( uid, KHomescreenUid, msg ); CleanupStack::PopAndDestroy( launcher ); } diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Tue Sep 14 21:55:16 2010 +0300 @@ -159,6 +159,11 @@ */ void HandleListBoxSelectionL(); + /** + * Callback function to be used with CPeriodic. + */ + static TInt TimerCallbackL( TAny *aPtr ); + private: // data /** @@ -166,6 +171,12 @@ * Own. */ CMCSPluginSettingsModel* iModel; + + /** + * Timer to change specified shortcut when view is activated. + * Own. + */ + CPeriodic* iTimer; }; #endif // MCSPLUGINSETTINGS_H diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Tue Sep 14 21:55:16 2010 +0300 @@ -130,6 +130,11 @@ */ TPtrC UndefinedText() { return *iUndefinedText; }; + /** + * Returns title for empty item + */ + TPtrC EmptyText() { return *iEmptyText; }; + private: /** * Constructor @@ -169,6 +174,14 @@ */ void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ); + /** + * Returns title for requested item + * + * @param aUid Shortcut items uid + * @return HBufC title + */ + HBufC* MenuItemTextL( const TDesC& aUid ); + private: // data /** @@ -192,10 +205,11 @@ */ HBufC* iUndefinedText; - /* - * Undefined MCS item, own + /** + * Name of "Empty" application, own */ - CMenuItem* iUndefinedItem; + HBufC* iEmptyText; + }; #endif // CMCSPLUGINSETTINGSAPPLIST_H diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Tue Sep 14 21:55:16 2010 +0300 @@ -117,7 +117,12 @@ * Hanle notify */ void HandleNotifyL(); - + + /** + * Sets currently selected index + */ + void SetCurrentItemIndex(TInt aIdx); + private: /* diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Tue Sep 14 21:55:16 2010 +0300 @@ -52,6 +52,7 @@ TInt id; TSettingType type; TBool locked; + TBool empty; }; /** @@ -222,6 +223,14 @@ TBool SettingLockedL( RPointerArray& aProperties ); + /** + * Empty setting + * + * @param aProperties + * @return TBool + */ + TBool SettingEmptyL( + RPointerArray& aProperties ); /** diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -75,6 +75,8 @@ // void CMCSPluginSettings::ConstructL() { + iTimer = CPeriodic::NewL( CActive::EPriorityUserInput ); + FeatureManager::InitializeLibL(); TParsePtrC driveParse(PathInfo::RomRootPath()); @@ -113,6 +115,12 @@ FeatureManager::UnInitializeLib(); iResourceLoader.Close(); delete iModel; + + if (iTimer->IsActive()) + { + iTimer->Cancel(); + } + delete iTimer; } // --------------------------------------------------------------------------- @@ -160,11 +168,49 @@ // void CMCSPluginSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) { - iModel->SetPluginIdL( aCustomMessage ); + // Parse the custom message + TInt locate = aCustomMessage.Locate('/'); + TInt editIdx = -1; + iModel->UpdateAppListL( EFalse ); iModel->UpdateBkmListL( EFalse ); - iModel->UpdateSettingsL(); - CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + if (locate > 0) + { + // if / is located in the custom mesage + // upto / is the plugin id + iModel->SetPluginIdL(aCustomMessage.Left(locate)); + + // right most character is the edit index + TLex8 lex(aCustomMessage.Right(1)); + lex.Val(editIdx); + + iModel->UpdateSettingsL(); + CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, + aCustomMessage.Left(locate)); + + if (editIdx > 0) + { + // set the current edit item + Container()->SetCurrentItemIndex(editIdx - 1); + + // Set timer for handle the change of shortcut item + // Otherwise status bar is not shown correctly + if (iTimer->IsActive()) + { + iTimer->Cancel(); + } + iTimer->Start( 0, 0, TCallBack( TimerCallbackL, this ) ); + } + } + else + { + // if '/' is not located, custommessage has only the plugin id + iModel->SetPluginIdL(aCustomMessage); + iModel->UpdateSettingsL(); + CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, + aCustomMessage); + } } // ---------------------------------------------------------------------------- @@ -258,4 +304,18 @@ Container()->HandleChangeCommandL(); } +// --------------------------------------------------------------------------- +// Callback for direct settings change +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettings::TimerCallbackL( TAny *aPtr ) + { + CMCSPluginSettings* self = reinterpret_cast< CMCSPluginSettings* >( aPtr ); + self->iTimer->Cancel(); + // Handle the change + self->HandleListBoxSelectionL(); + + return 0; + } + // End of File. diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -30,6 +30,7 @@ _LIT8( KItemLocked, "locked"); _LIT8( KProperValueFolder, "folder" ); _LIT( KMenuAttrUndefUid, "0x99999991" ); +_LIT( KMenuAttrInvokeSettingsUid, "0x99999990" ); _LIT( KMenuItemLongName, "long_name" ); #define KMCSCmailMtmUidValue 0x2001F406 @@ -54,44 +55,10 @@ iMenu.OpenL( KMyMenuData ); - // Get "Undefined" icon and text - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - - // 'Undefined' item - filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); - - TMenuItem item; - const TInt root = iMenu.RootFolderL(); - RArray items; - CleanupClosePushL( items ); - iMenu.GetItemsL( items, root, filter, ETrue ); - - if ( items.Count() > 0 ) - { - iUndefinedItem = CMenuItem::OpenL( iMenu, items[ 0 ] ); - iUndefinedText = NULL; + iUndefinedText = MenuItemTextL( KMenuAttrUndefUid ); + iEmptyText = MenuItemTextL( KMenuAttrInvokeSettingsUid ); + } - if ( iUndefinedItem ) - { - TBool exists( KErrNotFound );//CleanupStack::PushL( undefinedItem ); - TPtrC undefined = iUndefinedItem->GetAttributeL( KMenuItemLongName, exists ); - - if ( exists ) - { - iUndefinedText = HBufC::NewMaxL( undefined.Length() ); - iUndefinedText->Des().Copy( undefined ); - } - else - { - iUndefinedText = KNullDesC().Alloc(); - } - } - } - - CleanupStack::PopAndDestroy( &items ); - CleanupStack::PopAndDestroy( filter ); - } // --------------------------------------------------------------------------- // Two-phased constructor @@ -118,7 +85,7 @@ iMenu.Close(); delete iUndefinedText; - delete iUndefinedItem; + delete iEmptyText; } // --------------------------------------------------------------------------- @@ -188,7 +155,7 @@ RPointerArray& aProperties ) { TBool attrExists( EFalse ); - TSettingItem settingItem = { KErrNotFound, EApplication, EFalse }; + TSettingItem settingItem = { KErrNotFound, EApplication, EFalse, EFalse }; TBool isFolder = EFalse; // check if the item is folder @@ -414,4 +381,56 @@ CleanupStack::Pop( newItem ); } +// --------------------------------------------------------------------------- +// Gets specified menu item text +// --------------------------------------------------------------------------- +// +HBufC* CMCSPluginSettingsAppList::MenuItemTextL( const TDesC& aUid ) + { + HBufC* text = NULL; + + // Get specified icon and text + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + // Filter specified item + filter->HaveAttributeL( KMenuAttrUid, aUid ); + + const TInt root = iMenu.RootFolderL(); + RArray items; + CleanupClosePushL( items ); + iMenu.GetItemsL( items, root, filter, ETrue ); + + CMenuItem* item = NULL; + + if ( items.Count() > 0 ) + { + item = CMenuItem::OpenL( iMenu, items[ 0 ] ); + + if ( item ) + { + TBool exists( KErrNotFound ); + TPtrC itemName = item->GetAttributeL( KMenuItemLongName, exists ); + + if ( exists ) + { + text = HBufC::NewMaxL( itemName.Length() ); + text->Des().Copy( itemName ); + } + delete item; + } + } + + if( !text ) + { + text = KNullDesC().Alloc(); + } + + CleanupStack::PopAndDestroy( &items ); + CleanupStack::PopAndDestroy( filter ); + + return text; + } + + // End of File. diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -111,7 +111,7 @@ TSettingItem CMCSPluginSettingsBkmList::FindItemL( RPointerArray& aProperties ) { TInt index( KErrNotFound ); - TSettingItem settingItem = { KErrNotFound, EBookmark, EFalse }; + TSettingItem settingItem = { KErrNotFound, EBookmark, EFalse, EFalse }; for( TInt i= 0; i < aProperties.Count(); i++ ) { if( aProperties[i]->Name() == KUid ) @@ -247,7 +247,7 @@ CleanupStack::PushL( newItem ); newItem->SetAttributeL( KMenuAttrUid, aUid ); newItem->SetAttributeL( KMenuAttrLongName, aName ); - newItem->SetAttributeL( KMenuAttrView, aUrl ); + newItem->SetAttributeL( KMenuAttrUrl, aUrl ); newItem->SetAttributeL( KMenuAttrParameter, aName ); iMenuItems.AppendL( newItem ); CleanupStack::Pop( newItem ); diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -472,4 +472,16 @@ iNotifyWatcher->WatchNotify( this ); } +// --------------------------------------------------------------------------- +// Sets the currently selected item +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::SetCurrentItemIndex( TInt aIdx ) + { + if( iListBox ) + { + iListBox->SetCurrentItemIndex( aIdx ); + } + } + // End of File. diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -49,6 +49,7 @@ _LIT8( KProperValueAppl, "application" ); _LIT8( KProperValueMailbox, "mailbox" ); _LIT( KMenuTypeMailbox, "menu:mailbox" ); +_LIT8( KMenuAttrInvokeSettingsUid, "0x99999990" ); using namespace HSPluginSettingsIf; @@ -230,7 +231,7 @@ TSettingItem CMCSPluginSettingsModel::ItemL( RPointerArray& aProperties ) { - TSettingItem setting = { KErrNotFound, EApplication , EFalse }; + TSettingItem setting = { KErrNotFound, EApplication , EFalse, EFalse }; TSettingType type = SettingTypeL( aProperties ); if ( type == EApplication || type == EMailbox ) @@ -243,7 +244,8 @@ } setting.locked = SettingLockedL( aProperties ); - + setting.empty = SettingEmptyL( aProperties ); + return setting; } @@ -301,6 +303,30 @@ } // --------------------------------------------------------------------------- +// Gets empty status of given HSPS entry +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsModel::SettingEmptyL( + RPointerArray& aProperties ) + { + + for( TInt i = 0; i Name(); + if( name == KProperNameUid ) + { + TPtrC8 value = aProperties[i]->Value(); + if( value.Compare(KMenuAttrInvokeSettingsUid) == 0 ) + { + return ETrue; + } + } + } + + return EFalse; + } + +// --------------------------------------------------------------------------- // Saves menuitem to HSPS to the given shortcut index // --------------------------------------------------------------------------- // @@ -402,7 +428,18 @@ } else if ( properties[ i ]->Name() == KProperNameView ) { - TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists ); + TPtrC type = aMenuItem.Type(); + TPtrC attr; + if ( type == KMenuTypeUrl ) + { + // In case of bookmark type item, bookmark URL is stored to view property + attr.Set( KMenuAttrUrl ); + } + else + { + attr.Set( KMenuAttrView ); + } + TPtrC view = aMenuItem.GetAttributeL( attr, exists ); if( exists && view.Length() > 0 ) { HBufC8* view8( NULL ); @@ -470,8 +507,8 @@ } } - // ETrue tells that modified settings are stored also to plugin reference - User::LeaveIfError( iPluginSettings->SetSettingsL( *iPluginId, settingItems, ETrue ) ); + // EFalse tells that modified settings are not stored to plugin reference + User::LeaveIfError( iPluginSettings->SetSettingsL( *iPluginId, settingItems, EFalse ) ); CleanupStack::PopAndDestroy(); // settingItems } @@ -515,10 +552,19 @@ // first, we need to check if the item is missing // (application uninstalled or mmc card removed) // If it is, we return "Undefined" application name instead + // In case of empty item, it's own name is returned if ( iSettings[ aIndex ].id == KErrNotFound ) { - const TDesC& caption = iAppList->UndefinedText(); - TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + if ( iSettings[ aIndex ].empty ) + { + const TDesC& caption = iAppList->EmptyText(); + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + } + else + { + const TDesC& caption = iAppList->UndefinedText(); + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + } } else { @@ -555,7 +601,7 @@ // const TSettingItem CMCSPluginSettingsModel::Item( TInt aIndex ) const { - TSettingItem setting = { KErrNotFound, EApplication, EFalse }; + TSettingItem setting = { KErrNotFound, EApplication, EFalse, EFalse }; if ( aIndex >= 0 && aIndex < iSettings.Count() ) { diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -241,7 +241,9 @@ if ( icon != NULL ) // Syntax correct but icon not found { aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); + CleanupStack::PushL( icon ); + iIconArray.AppendL( icon ); + CleanupStack::Pop( icon ); } else { @@ -285,6 +287,7 @@ { // Take the ownership CGulIcon* icon = CGulIcon::NewL(bitmap); + CleanupStack::PushL( icon ); if( aMaskHandle != KErrBadHandle ) { CFbsBitmap* mask = new (ELeave) CFbsBitmap(); @@ -294,7 +297,8 @@ } } aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); + iIconArray.AppendL( icon ); + CleanupStack::Pop( icon ); } else { @@ -484,8 +488,6 @@ void CSapiDataPlugin::Stop( TStopReason aReason ) { TRAP_IGNORE( StopL( aReason ) ); - - iPluginState = EStopped; } // ---------------------------------------------------------------------------- @@ -495,23 +497,28 @@ // void CSapiDataPlugin::StopL( TStopReason aReason ) { - if ( aReason == ESystemShutdown ) + if ( iPluginState != EStopped ) { - iData->ChangePublisherStatusL( KSystemShutdown ); - } - else if ( aReason == EPageShutdown ) - { - iData->ChangePublisherStatusL( KPageShutdown ); + if ( aReason == ESystemShutdown ) + { + iData->ChangePublisherStatusL( KSystemShutdown ); + } + else if ( aReason == EPageShutdown ) + { + iData->ChangePublisherStatusL( KPageShutdown ); + } + else if ( aReason == EPluginShutdown ) + { + iData->ChangePublisherStatusL( KPluginShutdown ); + } + + if ( iData ) + { + iData->ChangePublisherStatusL( KDeActive ); + } + + iPluginState = EStopped; } - else if ( aReason == EPluginShutdown ) - { - iData->ChangePublisherStatusL( KPluginShutdown ); - } - - if ( iData ) - { - iData->ChangePublisherStatusL( KDeActive ); - } } // ---------------------------------------------------------------------------- diff -r a5a39a295112 -r 8baec10861af idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -582,7 +582,9 @@ if ( icon != NULL ) // Syntax correct but icon not found { aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); + CleanupStack::PushL( icon ); + iIconArray.AppendL( icon ); + CleanupStack::Pop( icon ); } else { @@ -626,6 +628,7 @@ { // Take the ownership CGulIcon* icon = CGulIcon::NewL(bitmap); + CleanupStack::PushL( icon ); if( aMaskHandle != KErrBadHandle ) { CFbsBitmap* mask = new (ELeave) CFbsBitmap(); @@ -635,7 +638,8 @@ } } aObserver->PublishPtr( *this, aContentId, icon , aContentId ); - iIconArray.Append(icon); + iIconArray.AppendL( icon ); + CleanupStack::Pop( icon ); } else { diff -r a5a39a295112 -r 8baec10861af idlefw/src/framework/aicpsexecuteparam.cpp --- a/idlefw/src/framework/aicpsexecuteparam.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/src/framework/aicpsexecuteparam.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -201,7 +201,7 @@ // void CAiCpsExecuteParam::AddActionL(const TDesC8& aAction) { - iActions.Append(aAction.AllocL()); + iActions.AppendL(aAction.AllocL()); } // End of file diff -r a5a39a295112 -r 8baec10861af idlefw/src/framework/aipluginfactory.cpp --- a/idlefw/src/framework/aipluginfactory.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/src/framework/aipluginfactory.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -512,7 +512,7 @@ ConfigurePluginL( *plugin, info ) ); // Take plugin's ownership - iPublishers.Append( plugin ); + iPublishers.AppendL( plugin ); CleanupStack::Pop( plugin ); } diff -r a5a39a295112 -r 8baec10861af idlefw/src/framework/aiuicontrollermanager.cpp --- a/idlefw/src/framework/aiuicontrollermanager.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/src/framework/aiuicontrollermanager.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -55,9 +55,9 @@ User::LeaveIfError( aRepository.Get( KAiMainUIController, value ) ); CAiUiController* controller = CAiUiController::NewL( TUid::Uid( value ) ); - - iCreatedUICList.Append( value ); CleanupStack::PushL( controller ); + + iCreatedUICList.AppendL( value ); iMainUiController = controller->MainInterface(); @@ -98,7 +98,7 @@ continue; } - iCreatedUICList.Append( value ); + iCreatedUICList.AppendL( value ); CAiUiController* controller = CAiUiController::NewL( TUid::Uid( value ) ); diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/devicestatusplugin/group/MT_DevStaPlg.mmp --- a/idlefw/tsrc/devicestatusplugin/group/MT_DevStaPlg.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/devicestatusplugin/group/MT_DevStaPlg.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -36,15 +36,12 @@ USERINCLUDE ../mt_devstaplg USERINCLUDE ../stub/src -USERINCLUDE ../../../../inc/common -USERINCLUDE ../../../../inc/framework -USERINCLUDE ../../../../group -USERINCLUDE ../../../../plugins/devicestatus/inc -USERINCLUDE ../../../../../../homescreen/idlehomescreen/inc -USERINCLUDE ../../../../../../homescreen/idlehomescreen/nativeuicontroller/inc -USERINCLUDE ../../../../../idlefw/plugins/profileplugin/inc -USERINCLUDE ../../../../../../../app/homescreen/idlehomescreen/inc -USERINCLUDE ../../../../../../../app/homescreen/idlehomescreen/nativeuicontroller/inc +USERINCLUDE ../../../plugins/devicestatus/inc +USERINCLUDE ../../../../../homescreen/idlehomescreen/inc +USERINCLUDE ../../../../../homescreen/idlehomescreen/nativeuicontroller/inc +USERINCLUDE ../../../../idlefw/plugins/profileplugin/inc +USERINCLUDE ../../../../../../app/homescreen/idlehomescreen/inc +USERINCLUDE ../../../../../../app/homescreen/idlehomescreen/nativeuicontroller/inc APP_LAYER_SYSTEMINCLUDE diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/devicestatusplugin/mt_devstaplg/MT_DevStaPlg.cpp --- a/idlefw/tsrc/devicestatusplugin/mt_devstaplg/MT_DevStaPlg.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/devicestatusplugin/mt_devstaplg/MT_DevStaPlg.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -559,7 +559,7 @@ { User::Leave( KErrNoMemory ); } - /* + MAiPropertyExtension* ext = static_cast( iPublisher->Extension( KExtensionUidProperty ) ); MAiContentRequest* request = static_cast( ext->GetPropertyL( EAiContentRequest ) ); @@ -657,7 +657,7 @@ CStubDataHolder::Instance()->SetCurrentProfileL( KProfGeneral, EProfileGeneralId ); - /* + MAiPropertyExtension* ext = static_cast( iPublisher->Extension( KExtensionUidProperty ) ); MAiContentRequest* request = static_cast( ext->GetPropertyL( EAiContentRequest ) ); diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/devicestatusplugin/mt_devstaplg/contentobserver.cpp --- a/idlefw/tsrc/devicestatusplugin/mt_devstaplg/contentobserver.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/devicestatusplugin/mt_devstaplg/contentobserver.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -96,19 +96,19 @@ } -TInt CContentObserver::StartTransaction(TInt aTxId) +TInt CContentObserver::StartTransaction(TInt /*aTxId*/) { return 0; } -TInt CContentObserver::Commit(TInt aTxId) +TInt CContentObserver::Commit(TInt /*aTxId*/) { return 0; } -TInt CContentObserver::CancelTransaction(TInt aTxId) +TInt CContentObserver::CancelTransaction(TInt /*aTxId*/) { return 0; } @@ -120,7 +120,7 @@ } -TInt CContentObserver::Publish(CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) +TInt CContentObserver::Publish(CHsContentPublisher& /*aPlugin*/, TInt aContent, TInt aResource, TInt aIndex ) { RDebug::Print( _L("Publish(%d, %d, %d)"), aContent, aResource, aIndex ); CContentCache* cache = new( ELeave )CContentCache; @@ -133,7 +133,7 @@ return 0; } -TInt CContentObserver::Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) +TInt CContentObserver::Publish(CHsContentPublisher& /*aPlugin*/, TInt aContent, const TDesC16& aText, TInt aIndex ) { RDebug::Print( _L("Publish(%d, \"%S\", %d)"), aContent, &aText, aIndex ); CContentCache* cache = new( ELeave )CContentCache; @@ -147,7 +147,7 @@ } -TInt CContentObserver::Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) +TInt CContentObserver::Publish(CHsContentPublisher& /*aPlugin*/, TInt aContent, const TDesC8& aBuf, TInt aIndex ) { RDebug::Print( _L("Publish(%d, Buf.Len=%d, %d)"), aContent, aBuf.Length(), aIndex ); CContentCache* cache = new( ELeave )CContentCache; @@ -161,7 +161,7 @@ } -TInt CContentObserver::Publish(CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) +TInt CContentObserver::Publish(CHsContentPublisher& /*aPlugin*/, TInt aContent, RFile& /*aFile*/, TInt aIndex ) { CContentCache* cache = new( ELeave )CContentCache; CleanupStack::PushL( cache ); @@ -173,7 +173,7 @@ } -TInt CContentObserver::Clean(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex) +TInt CContentObserver::Clean(CHsContentPublisher& /*aPlugin*/, TInt aContent, TInt aIndex) { RDebug::Print( _L("Clean(%d, %d)"), aContent, aIndex ); CContentCache* cache = new( ELeave )CContentCache; @@ -187,12 +187,12 @@ } -TAny* CContentObserver::Extension(TUid aUid) +TAny* CContentObserver::Extension(TUid /*aUid*/) { return NULL; } -TBool CContentObserver::RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const +TBool CContentObserver::RequiresSubscription( const THsPublisherInfo& /*aPublisherInfo*/ ) const { return EFalse; } diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/devicestatusplugin/stub/group/devstaplg.mmp --- a/idlefw/tsrc/devicestatusplugin/stub/group/devstaplg.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/devicestatusplugin/stub/group/devstaplg.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -29,11 +29,12 @@ #include #include -#include +//#include TARGET aidevstaplg.dll TARGETTYPE PLUGIN -UID 0x10009D8D AI_UID_ECOM_DLL_CONTENTPUBLISHER_DEVSTAPLUGIN +UID 0x10009D8D 0x102750F7 //AI_UID_ECOM_DLL_CONTENTPUBLISHER_DEVSTAPLUGIN + CAPABILITY EUNIT_CAPS diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/devicestatusplugin/stub/src/profileengine.cpp --- a/idlefw/tsrc/devicestatusplugin/stub/src/profileengine.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/devicestatusplugin/stub/src/profileengine.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -200,7 +200,9 @@ TProfileRingingVolume CProfileEngine::TempRingingVolumeL() const - { + { + TProfileRingingVolume vol = EProfileRingingVolumeLevel1; + return vol; } @@ -210,7 +212,9 @@ TProfileRingingVolume CProfileEngine::TempMediaVolumeL() const - { + { + TProfileRingingVolume vol = EProfileRingingVolumeLevel1; + return vol; } diff -r a5a39a295112 -r 8baec10861af idlefw/tsrc/mcsplugin/ut_mcsplugin/ut_mcspluginpublisher.cpp --- a/idlefw/tsrc/mcsplugin/ut_mcsplugin/ut_mcspluginpublisher.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/idlefw/tsrc/mcsplugin/ut_mcsplugin/ut_mcspluginpublisher.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -47,19 +47,13 @@ _LIT( KMenuMailboxIconId, "16388" ); _LIT( KMenuMailboxMaskId, "16389" ); _LIT( KMenuTypeMailbox, "menu:mailbox" ); -_LIT( KIcon, "icon" ); _LIT8( KProperNameType, "type" ); -_LIT8( KProperNameParam, "param" ); _LIT8( KProperNameUid, "uid" ); -_LIT8( KProperNameView, "view" ); -_LIT8( KProperNameLocked, "locked" ); _LIT8( KProperValueBookmark, "bookmark" ); _LIT8( KProperValueFolder, "folder" ); _LIT8( KProperValueMailbox, "mailbox" ); _LIT8( KMenuAttrUndefUid, "0x99999991" ); -_LIT8( KMenuAttrViewTest, "view:test" ); -_LIT8( KMenuAttrParamTest, "param:test" ); _LIT( KTestName, "test:name" ); _LIT( KTestIconAttr, "icon_attributes" ); @@ -203,7 +197,7 @@ void UT_MCSPluginPublisher::Teardown() { User::LeaveIfError( iPluginSettings->SetSettingsL( KNameSpace, - iSettings, ETrue )); + iSettings, EFalse )); iSettings.ResetAndDestroy(); @@ -231,8 +225,8 @@ data->SetNameL( KTestName ); data->SetValueL( KTestValue ); - EUNIT_ASSERT_EQUALS( data->Name(), KTestName ); - EUNIT_ASSERT_EQUALS( data->Value(), KTestValue ); + EUNIT_ASSERT_EQUALS( *data->Name(), KTestName ); + EUNIT_ASSERT_EQUALS( *data->Value(), KTestValue ); CleanupStack::PopAndDestroy( data ); } @@ -278,7 +272,7 @@ } User::LeaveIfError( iPluginSettings->SetSettingsL( KNameSpace, settings, - ETrue) ); + EFalse )); iMCSPlugin->iEngine->iPluginData->UpdateDataL(); CMCSData& itemData = iMCSPlugin->iEngine->iPluginData->DataItemL( 0 ); @@ -309,7 +303,7 @@ } User::LeaveIfError( iPluginSettings->SetSettingsL( KNameSpace, settings, - ETrue )); + EFalse )); iMCSPlugin->iEngine->iPluginData->UpdateDataL(); CMCSData& itemData = iMCSPlugin->iEngine->iPluginData->DataItemL( 0 ); @@ -340,7 +334,7 @@ } User::LeaveIfError( iPluginSettings->SetSettingsL( KNameSpace, settings, - ETrue)); + EFalse )); iMCSPlugin->iEngine->iPluginData->UpdateDataL(); CMCSData& itemData = iMCSPlugin->iEngine->iPluginData->DataItemL(0); diff -r a5a39a295112 -r 8baec10861af layers.sysdef.xml --- a/layers.sysdef.xml Wed Sep 01 12:22:09 2010 +0100 +++ b/layers.sysdef.xml Tue Sep 14 21:55:16 2010 +0300 @@ -23,7 +23,7 @@ - + diff -r a5a39a295112 -r 8baec10861af menucontentsrv/group/mcsmenu.mmp --- a/menucontentsrv/group/mcsmenu.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/group/mcsmenu.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: sa1spcx1#11.1.7.1.8 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: sa1spcx1#11.1.7.1.9 % << Don't touch! Updated by Synergy at check-out. * */ @@ -80,6 +80,7 @@ SOURCE mcsmmcobserver.cpp SOURCE mcsfreespaceobserver.cpp SOURCE mcsinstallnotifier.cpp +SOURCE mcsinstallstrategy.cpp SOURCE mcsgetlistcreatorinterface.cpp SOURCE mcsgetlisthandler.cpp diff -r a5a39a295112 -r 8baec10861af menucontentsrv/group/mcsmenusrv.mmp --- a/menucontentsrv/group/mcsmenusrv.mmp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/group/mcsmenusrv.mmp Tue Sep 14 21:55:16 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: sa1spcx1#5.1.9 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: sa1spcx1#5.1.10 % << Don't touch! Updated by Synergy at check-out. * */ @@ -27,7 +27,7 @@ TARGET mcsmenuserver.exe TARGETTYPE exe UID 0x1000008c MENU_SRV_UID3 -CAPABILITY AllFiles ProtServ ReadDeviceData +CAPABILITY AllFiles ProtServ ReadDeviceData ReadUserData VENDORID VID_DEFAULT EPOCSTACKSIZE 0x5000 diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvinc/mcsdrmhandler.h --- a/menucontentsrv/srvinc/mcsdrmhandler.h Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvinc/mcsdrmhandler.h Tue Sep 14 21:55:16 2010 +0300 @@ -32,24 +32,24 @@ * @lib mcsmenu.lib * @since S60 v5.0 */ -NONSHARABLE_CLASS( CMcsDrmHandler ): +NONSHARABLE_CLASS( CMcsDrmHandler ): public CBase, public MMcsInstallListener, public MMcsDrmObserver, public MMcsDrmAppScanner { public: - + /** * Two-phased constructor. Leaves on failure. * @return The constructed object. */ - - static CMcsDrmHandler* NewL( + + static CMcsDrmHandler* NewL( CMenuSrvEng& aSrvEng, CMenuSrvEngUtils& aUtils, CMcsCacheHandler& aCacheHandler ); - + /** * Destructor. * @since S60 v5.0 @@ -58,24 +58,25 @@ * @panic None. */ virtual ~CMcsDrmHandler(); - + void HandleDrmEvent( TUid aUid ); - + void HandleDrmAppEvent(); - + void EngineEvents( TInt aFolder, TInt aEvents ); /** * Handle Install Event */ - void HandleInstallNotifyL(TInt aPackageUid); - + void HandleInstallNotifyL( TUid aPackageUid, + CMcsInstallNotifier::TNotificationType aNotificationType ); + private: /** * Constructor. */ - CMcsDrmHandler( + CMcsDrmHandler( CMenuSrvEng& aSrvEng, CMenuSrvEngUtils& aUtils, CMcsCacheHandler& aCacheHandler ); @@ -84,27 +85,27 @@ * 2nd phase constructor. */ void ConstructL(); - - void AddRemoveObserversL( + + void AddRemoveObserversL( const RArray& aDrmProtectedArray ); - + TInt AppFolderIdL( TUid aUid ); - + private: // data - + RMcsDrmObserverManager iObserversManager; - - + + CMenuSrvEng& iSrvEng; ///< Menu Engine. Not own. - + CMenuSrvEngUtils& iUtils; - + CMcsCacheHandler& iCacheHandler; - + CMcsDrmScanner* iScanner; - + CMcsInstallNotifier* iInstallNotifier; - + }; #endif // __MCSDRMHANDLER_H__ diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvinc/mcsinstallnotifier.h --- a/menucontentsrv/srvinc/mcsinstallnotifier.h Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvinc/mcsinstallnotifier.h Tue Sep 14 21:55:16 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,8 +11,8 @@ * * Contributors: * -* Description: This class implements MMcsGetListCreatorInterface. It builds tree -* output list for getlist operation +* Description: This class implements MMcsGetListCreatorInterface. It builds tree +* output list for getlist operation * * */ @@ -20,9 +20,92 @@ #ifndef MCSINSTALLNOTIFIER_H_ #define MCSINSTALLNOTIFIER_H_ +#include #include #include +class CMcsNotifierStrategy; +class MMcsInstallListener; + +/** + * MCS Install notifier. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsInstallNotifier ) : public CActive + { +public: + + /** + * Enum defining notification type. + */ + enum TNotificationType + { + ENoNotification, ///< No notification. + ESisInstallNotification, ///< System installation notification. + EJavaInstallNotification, ///< Java instalation and uninstallation notification. + }; + + /** + * Creates an instance of CCaInstallNotifier. + * @param aNotifier Reference to notifier interface. + * @param aNotificationType Notification type. + */ + static CMcsInstallNotifier* NewL( MMcsInstallListener& aListener, + TNotificationType aNotificationType ); + + /** + * Destructor. + */ + virtual ~CMcsInstallNotifier(); + +private: + + /** + * Constructor. + * @param aListener Reference to listener interface. + */ + CMcsInstallNotifier( MMcsInstallListener& aListener ); + + /** + * Symbian 2nd phase constructor. + * @param aNotificationType Notification type. + */ + void ConstructL( TNotificationType aNotificationType ); + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * From CActive. + */ + TInt RunError( TInt aError ); + +private: + + /** + * RProperty - own. + */ + RProperty iProperty; + + /** + * MMcsInstallListener - own. + */ + MMcsInstallListener& iListener; + + /* + * Notification strategy - own. + */ + CMcsNotifierStrategy* iNotifierStrategy; + + }; /** * Interface for updating after installer events. @@ -31,109 +114,16 @@ */ class MMcsInstallListener { -protected: +public: + /** - * Enum defining the purpouse of the installation event. + * Pure virtual method. + * @param aUid uid of installed application. + * @param aOperation operation type, see TSASwisOperation. */ - enum TInstOp - { - EInstOpNone = 0x00000000, - EInstOpInstall = 0x00000001, - EInstOpUninstall = 0x00000002, - EInstOpRestore = 0x00000004 - }; -public: - virtual void HandleInstallNotifyL(TInt aEvent) = 0; + virtual void HandleInstallNotifyL( TUid aUid, + CMcsInstallNotifier::TNotificationType aNotificationType ) = 0; }; -/** - * MCS Install notifier. - * - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CMcsInstallNotifier ) : - public CActive - { - /** - * Enum defining the purpouse of the installation event. - */ - enum TInstOp - { - EInstOpNone = 0x00000000, - EInstOpInstall = 0x00000001, - EInstOpUninstall = 0x00000002, - EInstOpRestore = 0x00000004 - }; - - enum TInstOpStatus - { - EInstOpStatusNone = 0x00000000, - EInstOpStatusSuccess = 0x00000100, - EInstOpStatusAborted = 0x00000200 - }; -public: - - /** - * Creates an instance of CMCSInstallNotifier implementation. - * @param aNotifier Reference to notifier interface. - * @param aCategory Package uid. - * @param aKey Key for central repository. - */ - static CMcsInstallNotifier* NewL(MMcsInstallListener& aListener, TInt aKey ); - - /** - * Destructor. - */ - virtual ~CMcsInstallNotifier(); - -private: - - /** - * Constructor. - * @param aNotifier Reference to notifier interface. - * @param aCategory Package uid. - * @param aKey Key for central repository. - */ - CMcsInstallNotifier( MMcsInstallListener& aListener, TInt aKey ); - - /** - * Symbian 2nd phase constructor. - */ - void ConstructL(); - - /** - * From CActive. - */ - void DoCancel(); - - /** - * From CActive. - */ - void RunL(); - - /** - * From CActive. - */ - TInt RunError( TInt aError ); - -private: - /**. - * Own. - */ - RProperty iProperty; - - /** - * Interface for notifying changes in folder. - * Not Own. - */ - MMcsInstallListener& iListener; - - /* - * - */ - TInt iKey; - }; - - #endif /* MCSINSTALLNOTIFIER_H_ */ diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvinc/mcsinstallstrategy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsinstallstrategy.h Tue Sep 14 21:55:16 2010 +0300 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ + +#ifndef MCSINSTALLSTRATEGY_H +#define MCSINSTALLSTRATEGY_H + +#include "mcsinstallnotifier.h" +#include + +namespace Swi + { + class RSisRegistryEntry; + } + +/** + * Strategy interface. + * + * @since S60 v5.0 + */ +class CMcsNotifierStrategy: public CBase + { +public: + + /** + * Notifies listener with changes in property. + */ + virtual void NotifyListenerL() = 0; + +protected: + + /** + * Constructor. + * @param aProperty to read values from. + * @param aListener listener to notify. + */ + CMcsNotifierStrategy( + RProperty& aProperty, + MMcsInstallListener& aListener ); + +protected: + + /** + * Property. Not own. + */ + RProperty& iProperty; + + /** + * Listener. Not own. + */ + MMcsInstallListener& iListener; + + }; + +/** + * Swi Install strategy. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsSwiInstallStrategy ): public CMcsNotifierStrategy + { +public: + + /** + * Creates an instance of CCaInstallStrategy. + * @param aProperty to read values from. + * @param aListener listener to notify. + */ + static CMcsSwiInstallStrategy* NewL( + RProperty& aProperty, + MMcsInstallListener& aListener ); + + /** + * Notifies listener with changes in property. + */ + void NotifyListenerL(); + +private: + + /** + * Constructor. + * @param aProperty to read values from. + * @param aListener listener to notify. + */ + CMcsSwiInstallStrategy( + RProperty& aProperty, + MMcsInstallListener& aListener ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Handle Install Event. + * @param aUid installed/uninstalled app uid. + */ + void HandleInstallNotifyL( TInt aUid ); + + /** + * Notifies storage abaut change for aPackageEntry related app. + * @param aPackageEntry application package entry. + */ + void NotifyL( Swi::RSisRegistryEntry & aPackageEntry ); + + }; + +/** + * Mcs Java install strategy. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsJavaInstallStrategy ): public CMcsNotifierStrategy + { +public: + + /** + * Creates an instance of CCaInstallStrategy. + * @param aProperty to read values from. + * @param aListener listener to notify. + */ + static CMcsJavaInstallStrategy* NewL( + RProperty& aProperty, + MMcsInstallListener& aListener ); + + /** + * Notifies listener with changes in property. + */ + void NotifyListenerL(); + +private: + + /** + * Constructor. + * @param aProperty to read values from. + * @param aListener listener to notify. + */ + CMcsJavaInstallStrategy( + RProperty& aProperty, + MMcsInstallListener& aListener ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Handle Install Event. + * @param aUid installed/uninstalled app uid. + */ + void HandleInstallNotifyL( TUid aPackageUid ); + + }; + +#endif /* MCSINSTALLSTRATEGY_H */ +// End of File diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvinc/menusrvappscanner.h --- a/menucontentsrv/srvinc/menusrvappscanner.h Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvinc/menusrvappscanner.h Tue Sep 14 21:55:16 2010 +0300 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "menuengoperation.h" #include "mcssatnotifier.h" @@ -28,7 +29,8 @@ #include "mcsfreespaceobserver.h" #include "mcsmenuitem.h" #include "mcsmenunotifier.h" -#include +#include "mcsinstallnotifier.h" + // FORWARD DECLARATION @@ -64,7 +66,7 @@ NONSHARABLE_CLASS( CMenuSrvAppScanner ) : public CActive, public MMenuEngOperation, public MApaAppListServObserver, public MCenRepNotifyHandlerCallback, public MMcsSATNotifierCallback, - MMcsFreeSpaceObserver + MMcsFreeSpaceObserver, MMcsInstallListener { public: // Constructor @@ -82,6 +84,13 @@ CMenuEng& aEng, CMenuSrvEngUtils& aSrvEngUtils ); +public: + /** + * Schedule appscanner run. + * Self complete active object. + */ + void ScheduleScan(); + private: // Constructors and destructor /** @@ -135,14 +144,18 @@ private: // from MApaAppListServObserver + /** + * Application list event. + * @param aEvent only one type event exists. + */ void HandleAppListEvent( TInt aEvent ); private: // from MCenRepNotifyHandlerCallback /** * Called if one of CR keys has changed - * @param aId Id of the key that has changed. - * @param aNewValue The new value of the key. + * @param aKey Id of the key that has changed. + * @param aNewValue The new value of the key. */ void HandleNotifyString( TUint32 aKey, const TDesC16& aNewValue ); @@ -156,12 +169,15 @@ */ void SATChangeL(); -public: - /** - * Schedule appscanner run. - * Self complete active object. - */ - void ScheduleScan(); +private: // from MMcsInstallListener + + /** + * Called application is installed. + * @param aUid uid of an application. + * @param aOperation operation type. + */ + void HandleInstallNotifyL( TUid aUid, + CMcsInstallNotifier::TNotificationType aNotificationType ); private: // new methods @@ -175,7 +191,28 @@ * Add new menu item referring to this application. * @param aItem menu item. */ - void HandleMissingFlagUpdateL( const TMenuItem& aItem ); + void HandleMissingFlagUpdateL( + const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem ); + + /** + * Notifies engine abaut application installation. + */ + void InstallationNotifyL(); + + /** + * Removes uid from installed packages array. + * @param aUid application uid. + */ + void RemoveFromInstalledPackages( TUid aUid ); + + /** + * Removes uid from installed packages array. + * @param aUid application uid. + * @param aId Item ID. + * @param aEvent event for engine to append. + */ + CMenuEngObject& ModifiableObjectL( TUid aUid, TInt aId, + TInt aEvent = RMenuNotifier::EItemAttributeChanged ); /** * Updates hidden flag. @@ -453,6 +490,12 @@ CMcsFreeSpaceObserver* iFreeSpaceObserver; TBool iOpStatus; + + RArray iInstalledPackages; ///< Own. + + CMcsInstallNotifier* iSisInstallNotifier; ///< Native app notifier. Own. + CMcsInstallNotifier* iJavaInstallNotifier; ///< Java app notifier. Own. + }; #endif // __MENUSRVAPPSCANNER_H__ diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/mcscachehandler.cpp --- a/menucontentsrv/srvsrc/mcscachehandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvsrc/mcscachehandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Used for receive SIM Application name, icon or +* Description: Used for receive SIM Application name, icon or * visibility information. * */ @@ -33,7 +33,7 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -EXPORT_C CMcsCacheHandler* CMcsCacheHandler::NewL( +EXPORT_C CMcsCacheHandler* CMcsCacheHandler::NewL( CMenuEng& aEng, CMenuSrvEngUtils& aUtils ) { @@ -44,7 +44,7 @@ return self; } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------------- CMcsCacheHandler::~CMcsCacheHandler() @@ -58,7 +58,7 @@ // might leave. // ----------------------------------------------------------------------------- // -CMcsCacheHandler::CMcsCacheHandler( +CMcsCacheHandler::CMcsCacheHandler( CMenuEng& aEng, CMenuSrvEngUtils& aUtils ): iEng( aEng ), iUtils( aUtils ) { @@ -75,7 +75,7 @@ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsCacheHandler::HandleRemoveId( TInt aId ) { iAttrCache.RemoveId( aId ); @@ -83,7 +83,7 @@ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsCacheHandler::HandleRemoveAttribute( TInt aId, const TDesC& aAttrName ) { iAttrCache.RemoveAttribute(aId, aAttrName); @@ -91,7 +91,7 @@ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsCacheHandler::EngineEvents( TInt aEvents ) { if( aEvents & RMenuNotifier::EItemsAddedRemoved ) @@ -100,7 +100,7 @@ } if( aEvents & RMenuNotifier::EItemAttributeChanged ) { - TRAP_IGNORE(RemoveItemsWithChangedAttributesL()); + TRAP_IGNORE( RemoveItemsWithChangedAttributesL() ); } } @@ -118,9 +118,9 @@ TInt id = iAttrCache[i]->Id(); TPtrC name = iAttrCache[i]->Name(); TPtrC valueCache = iAttrCache[i]->Value(); - + TPtrC valueXml(KNullDesC); - + exist = iEng.ObjectL(id).FindAttribute( name, valueXml, dummy ); if( exist && valueXml != valueCache ) { @@ -151,4 +151,4 @@ } } -// End of File +// End of File diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/mcsdrmhandler.cpp --- a/menucontentsrv/srvsrc/mcsdrmhandler.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvsrc/mcsdrmhandler.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Used for receive SIM Application name, icon or +* Description: Used for receive SIM Application name, icon or * visibility information. * */ @@ -41,12 +41,12 @@ // ----------------------------------------------------------------------------- // -CMcsDrmHandler* CMcsDrmHandler::NewL( +CMcsDrmHandler* CMcsDrmHandler::NewL( CMenuSrvEng& aSrvEng, CMenuSrvEngUtils& aUtils, CMcsCacheHandler& aCacheHandler ) { - CMcsDrmHandler* self = new( ELeave ) + CMcsDrmHandler* self = new( ELeave ) CMcsDrmHandler( aSrvEng, aUtils, aCacheHandler ); CleanupStack::PushL( self ); self->ConstructL(); @@ -54,7 +54,7 @@ return self; } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // Destructor // ----------------------------------------------------------------------------- CMcsDrmHandler::~CMcsDrmHandler() @@ -70,10 +70,10 @@ // might leave. // ----------------------------------------------------------------------------- // -CMcsDrmHandler::CMcsDrmHandler( +CMcsDrmHandler::CMcsDrmHandler( CMenuSrvEng& aSrvEng, CMenuSrvEngUtils& aUtils, - CMcsCacheHandler& aCacheHandler ): + CMcsCacheHandler& aCacheHandler ): iObserversManager( aUtils ), iSrvEng( aSrvEng ), iUtils( aUtils ), iCacheHandler( aCacheHandler ) { @@ -87,47 +87,48 @@ void CMcsDrmHandler::ConstructL() { iScanner = CMcsDrmScanner::NewL( *this, iSrvEng, iUtils ); - iInstallNotifier = CMcsInstallNotifier::NewL(*this, KPSUidJavaLatestInstallation); + iInstallNotifier = CMcsInstallNotifier::NewL( + *this, CMcsInstallNotifier::EJavaInstallNotification ); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// TInt CMcsDrmHandler::AppFolderIdL( TUid aUid ) { - RArray mcsItems; + RArray mcsItems; CleanupClosePushL( mcsItems ); - + TInt root; iSrvEng.Engine().RootFolderL( root ); TMenuSrvTypeAttrFilter appFilter; - appFilter.SetType( KMenuTypeApp() ); - + appFilter.SetType( KMenuTypeApp() ); + TBuf uidString; MenuSrvUtil::UidToStringL( aUid.iUid, uidString, 0, EHex ); - + appFilter.SetAttr( KMenuAttrUid(), uidString ); iSrvEng.Engine().GetItemsL( mcsItems, root, &appFilter, ETrue ); - + TInt folderId = KErrNotFound; if (mcsItems.Count()) { folderId = mcsItems[0].Parent(); iCacheHandler.HandleRemoveAttribute(mcsItems[0].Id(), KMenuAttrDrmProtection); } - + CleanupStack::PopAndDestroy( &mcsItems ); return folderId; } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsDrmHandler::HandleDrmEvent( TUid aUid ) { TRAP_IGNORE( - iSrvEng.Engine().AppendNotifyL( AppFolderIdL( aUid ), + iSrvEng.Engine().AppendNotifyL( AppFolderIdL( aUid ), RMenuNotifier::EItemAttributeChanged ); iScanner->RemoveObserverAndScanL( aUid ); ); @@ -135,100 +136,69 @@ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsDrmHandler::HandleDrmAppEvent() { TRAP_IGNORE( AddRemoveObserversL( - iScanner->DrmProtectedAppArray() ) ); + iScanner->DrmProtectedAppArray() ) ); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// -void CMcsDrmHandler::AddRemoveObserversL( +// +void CMcsDrmHandler::AddRemoveObserversL( const RArray& aDrmProtectedArray ) { - iObserversManager.RemoveMissingObservers( aDrmProtectedArray ); + iObserversManager.RemoveMissingObservers( aDrmProtectedArray ); iObserversManager.CreateObserversL( aDrmProtectedArray, *this ); - } + } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// +// void CMcsDrmHandler::EngineEvents( TInt /*aFolder*/, TInt aEvents ) { if ( aEvents & RMenuNotifier::EItemsAddedRemoved ) { iScanner->Scan(); - } + } } // --------------------------------------------------------- -// CMcsDrmHandler::HandleInstallNotifyL +// // --------------------------------------------------------- // -void CMcsDrmHandler::HandleInstallNotifyL( TInt aPackageUid ) +void CMcsDrmHandler::HandleInstallNotifyL( TUid aPackageUid, + CMcsInstallNotifier::TNotificationType aNotificationType ) { - RArray uids; - CleanupClosePushL( uids ); - - Java::CJavaRegistry* javaRegistry; - javaRegistry = Java::CJavaRegistry::NewLC(); - - Java::CJavaRegistryEntry* regEntry = - javaRegistry->RegistryEntryL( TUid::Uid(aPackageUid) ); - - if( regEntry ) - { - CleanupStack::PushL( regEntry ); - - Java::TJavaRegistryEntryType entryType = regEntry->Type(); - - if ( ( entryType >= Java::EGeneralPackage ) && - (entryType < Java::EGeneralApplication) ) - { - //package entry - Java::CJavaRegistryPackageEntry* regPackageEntry = - static_cast( regEntry ); - regPackageEntry->GetEmbeddedEntries( uids ); - } - else - { - //application entry - uids.AppendL( regEntry->Uid() ); - } - - CleanupStack::PopAndDestroy( regEntry ); - for ( TInt i = 0; i< uids.Count(); i++ ) - { - if ( ( iScanner->DrmExpiredAppArray()).Find(uids[i]) != KErrNotFound ) - { - HandleDrmEvent( uids[i] ); - } - else - { - iObserversManager.RefreshObserverL( iScanner->DrmProtectedAppArray(), - uids[i], *this ); - } - } + if( aPackageUid != TUid::Null() ) + { + if ( ( iScanner->DrmExpiredAppArray()).Find( aPackageUid ) + != KErrNotFound ) + { + HandleDrmEvent( aPackageUid ); + } + else + { + iObserversManager.RefreshObserverL( + iScanner->DrmProtectedAppArray(), aPackageUid, *this ); + } } else { for ( TInt i = 0; i< iScanner->DrmProtectedAppArray().Count(); i++ ) { - iObserversManager.RefreshObserverL( iScanner->DrmProtectedAppArray(), - iScanner->DrmProtectedAppArray()[i], *this ); + iObserversManager.RefreshObserverL( + iScanner->DrmProtectedAppArray(), + iScanner->DrmProtectedAppArray()[i], + *this ); } for ( TInt i = 0; i< iScanner->DrmExpiredAppArray().Count(); i++ ) { HandleDrmEvent( iScanner->DrmExpiredAppArray()[i] ); - } + } } - - - CleanupStack::PopAndDestroy( javaRegistry ); - CleanupStack::PopAndDestroy( &uids ); } -// End of File +// End of File diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/mcsinstallnotifier.cpp --- a/menucontentsrv/srvsrc/mcsinstallnotifier.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvsrc/mcsinstallnotifier.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -17,68 +17,67 @@ #include #include "mcsinstallnotifier.h" -#include - -CMcsInstallNotifier* CMcsInstallNotifier::NewL(MMcsInstallListener& aListener, TInt aKey) - { - CMcsInstallNotifier* self = new (ELeave) CMcsInstallNotifier( aListener, aKey ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - - return self; - } - -CMcsInstallNotifier::~CMcsInstallNotifier() - { - Cancel( ); - iProperty.Close( ); - } - -CMcsInstallNotifier::CMcsInstallNotifier( MMcsInstallListener& aListener, TInt aKey ) : - CActive(EPriorityNormal), iListener(aListener) - { - iKey = aKey; - // Prepare automatically - iProperty.Attach( KUidSystemCategory, iKey ); - CActiveScheduler::Add( this ); - iProperty.Subscribe( iStatus ); - SetActive( ); - } +#include "mcsinstallstrategy.h" -void CMcsInstallNotifier::ConstructL() - { +CMcsInstallNotifier* CMcsInstallNotifier::NewL( + MMcsInstallListener& aListener, TNotificationType aNotificationType ) + { + CMcsInstallNotifier* self = new ( ELeave ) CMcsInstallNotifier( aListener ); + CleanupStack::PushL( self ); + self->ConstructL( aNotificationType ); + CleanupStack::Pop( self ); + return self; + } + +CMcsInstallNotifier::~CMcsInstallNotifier() + { + Cancel(); + iProperty.Close(); + delete iNotifierStrategy; + } - } +CMcsInstallNotifier::CMcsInstallNotifier( MMcsInstallListener& aListener ) : + CActive( EPriorityNormal ), iListener( aListener ) + { + CActiveScheduler::Add( this ); + SetActive(); + } +void CMcsInstallNotifier::ConstructL( TNotificationType aNotificationType ) + { + switch( aNotificationType ) + { + case ESisInstallNotification: + iNotifierStrategy = CMcsSwiInstallStrategy::NewL( + iProperty, iListener ); + break; + case EJavaInstallNotification: + iNotifierStrategy = CMcsJavaInstallStrategy::NewL( + iProperty, iListener ); + break; + default: + User::Leave( KErrNotSupported ); + break; + } + iProperty.Subscribe( iStatus ); + } void CMcsInstallNotifier::DoCancel() - { - iProperty.Cancel( ); - } - + { + iProperty.Cancel(); + } void CMcsInstallNotifier::RunL() - { - SetActive( ); - iProperty.Subscribe( iStatus ); - TInt status; - User::LeaveIfError( iProperty.Get( KUidSystemCategory, - iKey, status ) ); + { + SetActive(); + iProperty.Subscribe( iStatus ); + iNotifierStrategy->NotifyListenerL(); + } - if (( iKey == KPSUidJavaLatestInstallation ) || - ((status & EInstOpInstall )||(status & EInstOpUninstall )) && - (status & EInstOpStatusSuccess) ) - { - iListener.HandleInstallNotifyL(status); - } +TInt CMcsInstallNotifier::RunError( TInt /*aError*/) + { + // No need to do anything + return KErrNone; + } - } - - -TInt CMcsInstallNotifier::RunError( TInt /*aError*/ ) - { - // No need to do anything - return KErrNone; - } diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/mcsinstallstrategy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvsrc/mcsinstallstrategy.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: ?Description + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mcsinstallstrategy.h" + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsNotifierStrategy::CMcsNotifierStrategy( + RProperty& aProperty, MMcsInstallListener& aListener ) : + iProperty( aProperty ), iListener( aListener ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsSwiInstallStrategy* CMcsSwiInstallStrategy::NewL( + RProperty& aProperty, MMcsInstallListener& aListener ) + { + CMcsSwiInstallStrategy* self = new ( ELeave ) CMcsSwiInstallStrategy( + aProperty, aListener ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMcsSwiInstallStrategy::NotifyListenerL() + { + TInt appUid; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KUidSwiLatestInstallation, appUid ) ); + if( appUid ) + { + HandleInstallNotifyL( appUid ); + } + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMcsSwiInstallStrategy::HandleInstallNotifyL( TInt aUid ) + { + Swi::RSisRegistrySession iSisRegSession; + User::LeaveIfError( iSisRegSession.Connect() ); + CleanupClosePushL( iSisRegSession ); + + // Open sis package entry related to aUid + Swi::RSisRegistryEntry packageEntry; + if( KErrNone == packageEntry.Open( iSisRegSession, TUid::Uid( aUid ) ) ) + { + CleanupClosePushL( packageEntry ); + + // Get packageEntry's embedded sis' + RPointerArray embedded; + CleanupClosePushL( embedded ); + packageEntry.EmbeddedPackagesL( embedded ); + if( embedded.Count() ) + { + // For each embadded sis we notify storage - recursive call + for( TInt i = 0; i < embedded.Count(); ++i ) + { + iListener.HandleInstallNotifyL( embedded[i]->Uid(), + CMcsInstallNotifier::ESisInstallNotification ); + } + } + else + { + // There are no embaddes sis', so we can notify storage + // of changes in apps included in packageEntry + NotifyL( packageEntry ); + } + embedded.ResetAndDestroy(); + CleanupStack::PopAndDestroy( &embedded ); + CleanupStack::PopAndDestroy( &packageEntry ); + } + + CleanupStack::PopAndDestroy( &iSisRegSession ); + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMcsSwiInstallStrategy::NotifyL( Swi::RSisRegistryEntry & aPackageEntry ) + { + // Get sids ( == uids of exetucables included in aPackageEntry ) + RArray sids; + CleanupClosePushL( sids ); + aPackageEntry.SidsL( sids ); + if( sids.Count() ) + { + // For each sid we notify storage + for( TInt i = 0; i < sids.Count(); ++i ) + { + iListener.HandleInstallNotifyL( + sids[i], CMcsInstallNotifier::ESisInstallNotification ); + } + } + CleanupStack::PopAndDestroy( &sids ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsSwiInstallStrategy::CMcsSwiInstallStrategy( + RProperty& aProperty, MMcsInstallListener& aListener ) + : CMcsNotifierStrategy( aProperty, aListener ) + { + iProperty.Attach( KUidSystemCategory, KUidSwiLatestInstallation ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMcsSwiInstallStrategy::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsJavaInstallStrategy* CMcsJavaInstallStrategy::NewL( + RProperty& aProperty, MMcsInstallListener& aListener ) + { + CMcsJavaInstallStrategy* self = + new ( ELeave ) CMcsJavaInstallStrategy( aProperty, aListener ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMcsJavaInstallStrategy::NotifyListenerL() + { + TInt state; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KPSUidJavaLatestInstallationState, state ) ); + if( ( ( state & ESASwisInstall ) || ( state & ESASwisUninstall ) ) + && ( state & ESASwisStatusSuccess ) ) + { + TInt appUid; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KPSUidJavaLatestInstallation, appUid ) ); + HandleInstallNotifyL( TUid::Uid( appUid ) ); + } + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMcsJavaInstallStrategy::HandleInstallNotifyL( TUid aPackageUid ) + { + RArray uids; + CleanupClosePushL( uids ); + + Java::CJavaRegistry* javaRegistry; + javaRegistry = Java::CJavaRegistry::NewLC(); + + Java::CJavaRegistryEntry* regEntry = + javaRegistry->RegistryEntryL( aPackageUid ); + + if( regEntry ) + { + CleanupStack::PushL( regEntry ); + + Java::TJavaRegistryEntryType entryType = regEntry->Type(); + + if ( ( entryType >= Java::EGeneralPackage ) && + (entryType < Java::EGeneralApplication) ) + { + //package entry + Java::CJavaRegistryPackageEntry* regPackageEntry = + static_cast( regEntry ); + regPackageEntry->GetEmbeddedEntries( uids ); + } + else + { + //application entry + uids.AppendL( regEntry->Uid() ); + } + + for ( TInt i = 0; i < uids.Count(); i++ ) + { + iListener.HandleInstallNotifyL( + uids[i], CMcsInstallNotifier::EJavaInstallNotification ); + } + + CleanupStack::PopAndDestroy( regEntry ); + } + else + { + iListener.HandleInstallNotifyL( + TUid::Null(), CMcsInstallNotifier::EJavaInstallNotification ); + } + CleanupStack::PopAndDestroy( javaRegistry ); + CleanupStack::PopAndDestroy( &uids ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsJavaInstallStrategy::CMcsJavaInstallStrategy( + RProperty& aProperty, MMcsInstallListener& aListener ) + : CMcsNotifierStrategy( aProperty, aListener ) + { + iProperty.Attach( KUidSystemCategory, KPSUidJavaLatestInstallationState ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMcsJavaInstallStrategy::ConstructL() + { + } + diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/menusrvappscanner.cpp --- a/menucontentsrv/srvsrc/menusrvappscanner.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvsrc/menusrvappscanner.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -73,6 +73,8 @@ { Cancel(); delete iMcsSatNotifier; + delete iSisInstallNotifier; + delete iJavaInstallNotifier; delete iNotifier; iEng.DequeueOperation( *this ); delete iMmcHistory; @@ -97,7 +99,7 @@ delete iCenRepNotifyHandlerCPHiddenFolders; delete iCenRepSession; delete iFreeSpaceObserver; - + iInstalledPackages.Close(); } // --------------------------------------------------------- @@ -160,7 +162,11 @@ iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this ); - //SetActive(); + iSisInstallNotifier = CMcsInstallNotifier::NewL( + *this, CMcsInstallNotifier::ESisInstallNotification ); + iJavaInstallNotifier = CMcsInstallNotifier::NewL( + *this, CMcsInstallNotifier::EJavaInstallNotification ); + ScheduleScan(); //iOpStatus = ETrue; } @@ -248,7 +254,8 @@ // CMenuSrvAppScanner::HideAppIfExists // --------------------------------------------------------- // -void CMenuSrvAppScanner::HideItemIfPresentL( TInt aFolder, TInt aId, const TDesC& aUid, TBool aWasHidden ) +void CMenuSrvAppScanner::HideItemIfPresentL( + TInt aFolder, TInt aId, const TDesC& aUid, TBool aWasHidden ) { TBool hideItem = EFalse; TMenuSrvAttrFilter uidAppFilter; @@ -258,21 +265,20 @@ CleanupClosePushL( appItems ); iEng.GetItemsL( appItems, aFolder, &uidAppFilter, ETrue ); - for (TInt i=0; i < appItems.Count(); i++) + for( TInt i=0; i < appItems.Count(); i++ ) { - if(appItems[i].Type() != KMenuTypeLink()) + if( appItems[i].Type() != KMenuTypeLink() ) { const TMenuItem& item = appItems[i]; - TBool itemHidden = (0 != (item.Flags() & TMenuItem::EHidden)); - TBool itemMissing = (0 != (item.Flags() & TMenuItem::EMissing)); + TBool itemHidden = (0 != ( item.Flags() & TMenuItem::EHidden ) ); + TBool itemMissing = ( 0 != ( item.Flags() & TMenuItem::EMissing ) ); if ( !itemHidden && !itemMissing ) { hideItem = ETrue; } } } - SetHiddenFlagL( aId, aWasHidden, hideItem ); CleanupStack::PopAndDestroy( &appItems ); @@ -284,7 +290,7 @@ // void CMenuSrvAppScanner::SetHiddenFlagL( TInt aId, TBool aWasHidden, TBool aHide ) { - if ( aWasHidden ^ aHide ) + if ( aWasHidden != aHide ) { iEng.ModifiableObjectL( aId, RMenuNotifier::EItemsAddedRemoved ). SetFlags( TMenuItem::EHidden, aHide ); @@ -465,6 +471,72 @@ User::RequestComplete( ownStatus, KErrNone ); } } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMenuSrvAppScanner::InstallationNotifyL() + { + TBool isLegacy = iEng.GetOnceLegacyFormat(); + for( TInt i = iInstalledPackages.Count() - 1; i >= 0; i-- ) + { + RArray mcsUidItems; + CleanupClosePushL( mcsUidItems ); + GetMcsAppItemsL( isLegacy, iInstalledPackages[i].iUid, mcsUidItems ); + if( mcsUidItems.Count() ) + { + iEng.ModifiableObjectL( mcsUidItems[0].Id() ); + iInstalledPackages.Remove( i ); + } + CleanupStack::PopAndDestroy( &mcsUidItems ); + } + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMenuSrvAppScanner::RemoveFromInstalledPackages( TUid aUid ) + { + TInt appIndex = iInstalledPackages.Find( aUid ); + if( appIndex != KErrNotFound ) + { + iInstalledPackages.Remove( appIndex ); + } + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +CMenuEngObject& CMenuSrvAppScanner::ModifiableObjectL( TUid aUid, TInt aId, + TInt aEvent ) + { + if( aEvent != RMenuNotifier::EItemsNone ) + { + RemoveFromInstalledPackages( aUid ); + } + return iEng.ModifiableObjectL( aId, aEvent ); + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CMenuSrvAppScanner::HandleInstallNotifyL( TUid aUid, + CMcsInstallNotifier::TNotificationType aNotificationType ) + { + iInstalledPackages.AppendL( aUid ); + // when installing java, appscanner first gets notification from appArc, + // and then it is notified with instal notifier(RProperty) + // so we need another scan for java apps + if( aNotificationType == CMcsInstallNotifier::EJavaInstallNotification ) + { + ScheduleScan(); + } + } + // --------------------------------------------------------- // CMenuSrvAppScanner::RunMenuEngOperationL // --------------------------------------------------------- @@ -474,10 +546,10 @@ UpdateApplicationItemsL(); UpdateApplicationWithHideIfInstalledItemsL(); UpdateLinkItemsL(); + InstallationNotifyL(); iOpStatus = EFalse; } - // --------------------------------------------------------- // CMenuSrvAppScanner::UpdateApplicationItemL // --------------------------------------------------------- @@ -488,8 +560,8 @@ { RArray mcsUidItems; CleanupClosePushL( mcsUidItems ); - TUid appuid = aApaItem.GetUid(); - GetMcsAppItemsL( isLegacy, appuid.iUid, mcsUidItems ); + TUid appUid = aApaItem.GetUid(); + GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems ); TBool isApaItemHidden( aApaItem.IsHidden() ); // This app is not in the menu, add it now. @@ -497,9 +569,9 @@ // do not display Menu app if ( !mcsUidItems.Count() && !isApaItemHidden - && appuid != KMmUid3 ) + && appUid != KMmUid3 ) { - if( appuid == KSatUid ) + if( appUid == KSatUid ) { if( CMcsSatHandler::CheckVisibility() ) { @@ -509,7 +581,8 @@ else { AddAppItemL( aApaItem, aMmcId ); - GetMcsAppItemsL( isLegacy, appuid.iUid, mcsUidItems ); + GetMcsAppItemsL( isLegacy, appUid.iUid, mcsUidItems ); + RemoveFromInstalledPackages( appUid ); } }//if @@ -520,11 +593,10 @@ //for every item with matching UID for (TInt j=0; j < mcsUidItems.Count(); j++) { - CMenuEngObject& object = - iEng.ModifiableObjectL( mcsUidItems[j].Id() ); TBuf uidString; - MenuSrvUtil::UidToStringL( appuid.iUid, uidString, EFalse, EHex ); - object.SetAttributeL( KMenuAttrUid(), uidString, EFalse ); + MenuSrvUtil::UidToStringL( appUid.iUid, uidString, EFalse, EHex ); + ModifiableObjectL( appUid, mcsUidItems[j].Id() ).SetAttributeL( + KMenuAttrUid(), uidString, EFalse ); }//for }//else if // "hidden", "missing" and "lock_delete" flags update @@ -542,10 +614,10 @@ HandleHiddenFlagUpdateL( item, aApaItem ); // "missing" flag handling - HandleMissingFlagUpdateL( item ); + HandleMissingFlagUpdateL( item, aApaItem ); //"lock_delete" flag handling - HandleLockDeleteFlagUpdateL(item, aApaItem ); + HandleLockDeleteFlagUpdateL( item, aApaItem ); // if item was just added to MCS it is not present in aMcsItems // so we cannot remove it TInt index = aMcsItems.Find( item, TIdentityRelation( IdMatch ) ); @@ -564,19 +636,22 @@ void CMenuSrvAppScanner::HandleHiddenFlagUpdateL( const TMenuItem & aItem, const CMenuSrvAppAttributes& aApaItem ) { - TBool itemHidden = (0 != (aItem.Flags() & TMenuItem::EHidden)); - if ( aApaItem.GetUid() == KSatUid ) + TBool itemHidden = ( 0 != ( aItem.Flags() & TMenuItem::EHidden ) ); + if( aApaItem.GetUid() == KSatUid ) { - if (itemHidden == CMcsSatHandler::CheckVisibility()) + if( itemHidden == CMcsSatHandler::CheckVisibility() ) { - iEng.ModifiableObjectL(aItem.Id(), RMenuNotifier::EItemsAddedRemoved). - SetFlags( TMenuItem::EHidden, !CMcsSatHandler::CheckVisibility()); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id(), + RMenuNotifier::EItemsAddedRemoved ).SetFlags( + TMenuItem::EHidden, + !CMcsSatHandler::CheckVisibility() ); } } - else if ( itemHidden != aApaItem.IsHidden() ) + else if( itemHidden != aApaItem.IsHidden() ) { - iEng.ModifiableObjectL(aItem.Id(), RMenuNotifier::EItemsAddedRemoved). - SetFlags( TMenuItem::EHidden, aApaItem.IsHidden() ); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id(), + RMenuNotifier::EItemsAddedRemoved ).SetFlags( + TMenuItem::EHidden, aApaItem.IsHidden() ); } } @@ -590,7 +665,7 @@ //we need this to delete uninstalled java app item if( aApaItem.GetAppType() != iEng.ObjectL( aItem.Id() ).GetAppType() ) { - iEng.ModifiableObjectL( aItem.Id(), + ModifiableObjectL( aApaItem.GetUid(), aItem.Id(), RMenuNotifier::EItemsNone ).SetAppType( aApaItem.GetAppType() ); } } @@ -603,27 +678,37 @@ void CMenuSrvAppScanner::HandleMmcAttrUpdateL( const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem, TUint aMmcId ) { - if ( IsInMmc( aApaItem ) ) + TPtrC val; + TBool dummy; + TBool attributeExists = iEng.ObjectL( aItem.Id() ).FindAttribute( + KMenuAttrMmcId(), val, dummy ); + if( IsInMmc( aApaItem ) ) { //app is instaled on mmc - KMenuAttrMmcId attribute update TBuf uidString; uidString.Format( KHexFormat, aMmcId ); - iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ). - SetAttributeL( KMenuAttrMmcId, uidString, EFalse ); + if( uidString.Compare( val ) ) + { + ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL( + KMenuAttrMmcId, uidString, EFalse ); + } } - else if ( IsInMassStorage( aApaItem ) + else if( IsInMassStorage( aApaItem ) && aApaItem.GetAppType() == CMenuEngObject::EWidgetApp ) { //its java app installed on mass storage, we need to leave it in xml //in case of connecting usb in mass storage mode - iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ). - SetAttributeL( KMenuAttrMmcId, KMenuMassStorage, EFalse ); + if( KMenuMassStorage().Compare( val ) ) + { + ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetAttributeL( + KMenuAttrMmcId, KMenuMassStorage, EFalse ); + } } - else + else if( attributeExists ) { //its installed on c: drive - remove attribute - iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ). - RemoveAttribute( KMenuAttrMmcId ); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).RemoveAttribute( + KMenuAttrMmcId ); } } // --------------------------------------------------------- @@ -641,14 +726,13 @@ GetCrItemsL( iSrvEngUtils.GetAppItemsL() ); TBool isLegacy = iEng.GetOnceLegacyFormat(); - //for every item in apaAndCrItems array for ( TInt i = ( iSrvEngUtils.GetAppItemsL().Count() - 1 ); i >= 0 ; i-- ) { // if there was leave for any item we ignore it // and proceed to the next one - TRAP_IGNORE(UpdateApplicationItemL( - mcsItems, *iSrvEngUtils.GetAppItemsL()[i], currentMmcId, isLegacy)); + TRAP_IGNORE( UpdateApplicationItemL( mcsItems, + *iSrvEngUtils.GetAppItemsL()[i], currentMmcId, isLegacy ) ); } // Here the big list contains menu items that refer to missing apps. HandleMissingItemsL( mcsItems ); @@ -668,16 +752,16 @@ { if ( ( aItem.Flags() & TMenuItem::ELockDelete ) == 0 ) { - iEng.ModifiableObjectL(aItem.Id()) - .SetFlags( TMenuItem::ELockDelete, ETrue ); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id()).SetFlags( + TMenuItem::ELockDelete, ETrue ); } } else { if ( ( aItem.Flags() & TMenuItem::ELockDelete ) != 0 ) { - iEng.ModifiableObjectL(aItem.Id()) - .SetFlags( TMenuItem::ELockDelete, EFalse ); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id() ).SetFlags( + TMenuItem::ELockDelete, EFalse ); } } } @@ -686,14 +770,16 @@ // CMenuSrvAppScanner::HandleMissingFlagUpdateL // --------------------------------------------------------- // -void CMenuSrvAppScanner::HandleMissingFlagUpdateL( const TMenuItem& aItem ) +void CMenuSrvAppScanner::HandleMissingFlagUpdateL( + const TMenuItem& aItem, const CMenuSrvAppAttributes& aApaItem ) { if ( aItem.Flags() & TMenuItem::EMissing ) { CLOG_WRITE_FORMAT8( "Unsetting flag EMissing on %d", item.Id() ); //application found so we unset "missing" flag - iEng.ModifiableObjectL( aItem.Id(), RMenuNotifier::EItemsAddedRemoved ). - SetFlags( TMenuItem::EMissing, EFalse ); + ModifiableObjectL( aApaItem.GetUid(), aItem.Id(), + RMenuNotifier::EItemsAddedRemoved ).SetFlags( + TMenuItem::EMissing, EFalse ); } } @@ -1104,8 +1190,8 @@ TBool itemFlagPresent = (0 != (aItem.Flags() & aFlag)); if( aFlagValue != itemFlagPresent ) { - iEng.ModifiableObjectL( aItem.Id(), aEvent ). - SetFlags( aFlag, aFlagValue ); + iEng.ModifiableObjectL( aItem.Id(), aEvent ). + SetFlags( aFlag, aFlagValue ); } } diff -r a5a39a295112 -r 8baec10861af menucontentsrv/srvsrc/menusrveng.cpp --- a/menucontentsrv/srvsrc/menusrveng.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/menucontentsrv/srvsrc/menusrveng.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -347,9 +347,8 @@ // CMenuSrvEng::GetRunningAppsL() // --------------------------------------------------------- // -void CMenuSrvEng::GetExtendedAttributesL(TInt aId, - const TDesC& aAttrName, TBool& aAttrExists, - TDes& aAttrVal ) +void CMenuSrvEng::GetExtendedAttributesL(TInt aId, const TDesC& aAttrName, + TBool& aAttrExists, TDes& aAttrVal ) { TBool captionInfo(aAttrName.Compare( KMenuAttrShortName ) == KErrNone || aAttrName.Compare( KMenuAttrLongName ) == KErrNone || @@ -376,6 +375,7 @@ else if( KErrNone == aAttrName.Compare( KMenuAttrNative ) ) { ApplicationNativeAttributeL( aId, aAttrExists, aAttrVal ); + addToCache = EFalse; } else // The attribute doesn't present for the item { @@ -384,7 +384,7 @@ } if( aAttrExists && addToCache ) { - AddToCacheL(aId, aAttrName, aAttrVal ); + AddToCacheL( aId, aAttrName, aAttrVal ); } } @@ -392,8 +392,8 @@ // CMenuSrvEng::ApplicationNativeAttributeL // --------------------------------------------------------- // -void CMenuSrvEng::ApplicationNativeAttributeL( - TInt aId, TBool & aAttrExists, TDes & aAttrVal ) +void CMenuSrvEng::ApplicationNativeAttributeL( TInt aId, + TBool & aAttrExists, TDes & aAttrVal ) { const CMenuEngObject & aEngObj = iEng->ObjectL(aId); @@ -449,7 +449,7 @@ void CMenuSrvEng::CaptionInfoL( TInt aId, const TDesC& aAttrName, TBool& aExists, TDes& aAttrVal ) { - const CMenuEngObject& obj = iEng->ObjectL(aId); + const CMenuEngObject& obj = iEng->ObjectL( aId ); if ( obj.Type().Compare( KMenuTypeFolder ) == KErrNone ) { TBool localized; @@ -459,15 +459,14 @@ { aExists = ETrue; aAttrVal = attrvalue; - AddToCacheL(aId, KMenuAttrLongName, aAttrVal ); - AddToCacheL(aId, KMenuAttrShortName, aAttrVal ); - AddToCacheL(aId, KMenuAttrTitleName, aAttrVal ); + AddToCacheL( aId, KMenuAttrLongName, aAttrVal ); + AddToCacheL( aId, KMenuAttrShortName, aAttrVal ); + AddToCacheL( aId, KMenuAttrTitleName, aAttrVal ); } } else if ( obj.Type().Compare( KMenuTypeApp ) == KErrNone ) { aAttrVal = AppCaptionInfoL( obj, aAttrName, aExists ); - AddToCacheL(aId, aAttrName, aAttrVal ); } else { @@ -562,7 +561,8 @@ // CMenuSrvEng::FolderChildrenCountL // --------------------------------------------------------- // - void CMenuSrvEng::FolderChildrenCountL( TInt aId, TBool& aExists, TDes& aAttrVal ) + void CMenuSrvEng::FolderChildrenCountL( + TInt aId, TBool& aExists, TDes& aAttrVal ) { const CMenuEngObject& obj = iEng->ObjectL(aId); @@ -680,47 +680,54 @@ void CMenuSrvEng::AppendExtendedAttrributesL( const TDesC& aType, RArray& aList ) - { - +{ if ( KErrNone == aType.Compare( KMenuTypeApp ) ) { - if( KErrNotFound == aList.Find( KMenuAttrTitleName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrTitleName ) ); - } - if( KErrNotFound == aList.Find( KMenuAttrShortName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrShortName ) ); - } - if( KErrNotFound == aList.Find( KMenuAttrLongName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrLongName ) ); - } - if( KErrNotFound == aList.Find( KMenuAttrDrmProtection(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrDrmProtection ) ); - } + if( KErrNotFound == aList.Find( KMenuAttrTitleName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrTitleName ) ); + } + if( KErrNotFound == aList.Find( KMenuAttrShortName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrShortName ) ); + } + if( KErrNotFound == aList.Find( KMenuAttrLongName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrLongName ) ); + } + if( KErrNotFound == aList.Find( KMenuAttrDrmProtection(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrDrmProtection ) ); + } } else if ( KErrNone == aType.Compare( KMenuTypeFolder ) ) { - if( KErrNotFound == aList.Find( KMenuAttrTitleName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrTitleName ) ); - } - if( KErrNotFound == aList.Find( KMenuAttrShortName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrShortName ) ); - } - if( KErrNotFound == aList.Find( KMenuAttrLongName(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KMenuAttrLongName ) ); - } - if( KErrNotFound == aList.Find( KChildrenCount(), TIdentityRelation( CmpAttrName )) ) - { - aList.AppendL( TPtrC( KChildrenCount ) ); - } + if( KErrNotFound == aList.Find( KMenuAttrTitleName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrTitleName ) ); + } + if( KErrNotFound == aList.Find( KMenuAttrShortName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrShortName ) ); + } + if( KErrNotFound == aList.Find( KMenuAttrLongName(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KMenuAttrLongName ) ); + } + if( KErrNotFound == aList.Find( KChildrenCount(), + TIdentityRelation( CmpAttrName )) ) + { + aList.AppendL( TPtrC( KChildrenCount ) ); + } } - } + } // End of File diff -r a5a39a295112 -r 8baec10861af xcfw/src/xcfwlocalizer.cpp --- a/xcfw/src/xcfwlocalizer.cpp Wed Sep 01 12:22:09 2010 +0100 +++ b/xcfw/src/xcfwlocalizer.cpp Tue Sep 14 21:55:16 2010 +0300 @@ -138,9 +138,10 @@ if( !BaflUtils::FileExists( aFileSystem, locfile->Des() ) ) { RArray langs; + CleanupClosePushL( langs ); BaflUtils::GetDowngradePathL( aFileSystem, langcode, langs ); //add current language to array for ROM fetching - langs.Append( langcode ); + langs.AppendL( langcode ); TInt current = langs.Count() - 1; do { @@ -165,8 +166,8 @@ } while ( current >= 0 && !BaflUtils::FileExists( aFileSystem, locfile->Des() ) ); } - langs.Reset(); - langs.Close(); + + CleanupStack::PopAndDestroy( &langs ); }