# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1283258250 -10800 # Node ID f23c07ec56e25cbee4ef70c84a528892ee62fbd8 # Parent b732521885346040b630022f8d90b3cf34994368 Revision: 201033 Kit: 201035 diff -r b73252188534 -r f23c07ec56e2 group/bld.inf --- a/group/bld.inf Thu Aug 19 10:20:41 2010 +0300 +++ b/group/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,8 @@ #include -#include "../locationmanager/inc/locplatsupport.mmh" + +#include "../rom/bld.inf" #include "../metadataengine/group/bld.inf" #include "../locationmanager/group/bld.inf" @@ -36,31 +37,7 @@ PRJ_EXPORTS -#if defined(_LOC_GEOTAGGING_CELLID) -#ifdef _LOC_REVERSEGEOCODE -../rom/mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) -#else -../rom/mds_cellidenabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) -#endif -#elif defined(_LOC_REVERSEGEOCODE) -#ifdef _LOC_GEOTAGGING_CELLID -../rom/mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) -#else -../rom/mds_reverse_geocode_enabled_only.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) -#endif -#else -../rom/mds.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) -#endif - -#ifdef RD_MDS_2_5 -../rom/ContentListingFramework.iby CORE_MW_LAYER_IBY_EXPORT_PATH( ContentListingFramework.iby ) -#endif - -//Stubs -../sis/mds/mds_stub.sis /epoc32/data/z/system/install/mds_stub.sis - PRJ_TESTMMPFILES PRJ_TESTEXPORTS -../rom/mds_testers.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds_testers.iby) diff -r b73252188534 -r f23c07ec56e2 harvester/blacklistserver/src/blacklistsession.cpp --- a/harvester/blacklistserver/src/blacklistsession.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/blacklistserver/src/blacklistsession.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -118,7 +118,7 @@ aMessage.ReadL( 0, mediaIdPckg ); RBuf uri; - uri.Create( aMessage.GetDesLength( 1 ) ); + User::LeaveIfError( uri.Create( aMessage.GetDesLength( 1 ) ) ); CleanupClosePushL( uri ); aMessage.ReadL( 1, uri ); diff -r b73252188534 -r f23c07ec56e2 harvester/client/inc/harvesterclientao.h --- a/harvester/client/inc/harvesterclientao.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/client/inc/harvesterclientao.h Tue Aug 31 15:37:30 2010 +0300 @@ -61,6 +61,8 @@ */ void Active(); + void CancelRequest(); + protected: /** @@ -111,6 +113,8 @@ * Harvester server assigned file name */ TFileName iURI; + + TBool iCancelled; }; #endif // __CHARVESTERCLIENTAO_H__ diff -r b73252188534 -r f23c07ec56e2 harvester/client/src/harvesterclient.cpp --- a/harvester/client/src/harvesterclient.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/client/src/harvesterclient.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -183,20 +183,23 @@ delete iSessionWatcher; iSessionWatcher = NULL; - + + WRITELOG( "RHarvesterClient::Close() - cancelling pending harvesting requests" ); if( iRequestQueue && iRequestQueue->RequestsPending() ) { iRequestQueue->Cancel(); } - // cancels Harvest Complete request if it exist at server + WRITELOG( "RHarvesterClient::Close() - removing harvester client observer" ); if( iObserver ) { RemoveObserver( iObserver ); } + UnregisterHarvestComplete(); WRITELOG( "RHarvesterClient::Close() - UnregisterHarvest done" ); + WRITELOG( "RHarvesterClient::Close() - forcing remaining harvesting requests" ); if( iRequestQueue && iRequestQueue->RequestsPending() ) { WRITELOG( "RHarvesterClient::Close() - Pending harvesting requests detected -> ForceHarvest" ); @@ -211,6 +214,7 @@ delete iHEO; iHEO = NULL; + WRITELOG( "RHarvesterClient::Close() - deleting harvester client AO" ); delete iHarvesterClientAO; iHarvesterClientAO = NULL; @@ -250,6 +254,7 @@ if ( iHarvesterClientAO ) { + WRITELOG( "RHarvesterClient::RemoveObserver() - calling iHarvesterClientAO->RemoveObserver" ); iHarvesterClientAO->RemoveObserver( aObserver ); } diff -r b73252188534 -r f23c07ec56e2 harvester/client/src/harvesterclientao.cpp --- a/harvester/client/src/harvesterclientao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/client/src/harvesterclientao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -51,7 +51,7 @@ OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::~CHarvesterClientAO" ); WRITELOG( "CHarvesterClientAO::~CHarvesterClientAO()" ); - Cancel(); + CancelRequest(); } // --------------------------------------------------------------------------- @@ -60,9 +60,10 @@ // --------------------------------------------------------------------------- // CHarvesterClientAO::CHarvesterClientAO( RHarvesterClient& aHarvesterClient ) - : CActive( CActive::EPriorityStandard ), + : CActive( CActive::EPriorityUserInput ), iObserver( NULL ), - iHarvesterClient( aHarvesterClient ) + iHarvesterClient( aHarvesterClient ), + iCancelled( EFalse ) { OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::CHarvesterClientAO" ); @@ -100,13 +101,14 @@ void CHarvesterClientAO::RemoveObserver( MHarvestObserver* /*aObserver*/ ) { WRITELOG( "CHarvesterClientAO::RemoveObserver()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_REMOVEOBSERVER, "CHarvesterClientAO::RemoveObserver" ); if ( iObserver ) { WRITELOG( "CHarvesterClientAO::RemoveObserver() - deleting observer" ); iObserver = NULL; } - Cancel(); + CancelRequest(); } // --------------------------------------------------------------------------- @@ -118,6 +120,7 @@ WRITELOG( "CHarvesterClientAO::DoCancel()" ); OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_DOCANCEL, "CHarvesterClientAO::DoCancel" ); iHarvesterClient.UnregisterHarvestComplete(); + WRITELOG( "CHarvesterClientAO::DoCancel() - end" ); } // --------------------------------------------------------------------------- @@ -126,9 +129,12 @@ // void CHarvesterClientAO::Active() { + WRITELOG( "CHarvesterClientAO::Active" ); if ( iObserver && !IsActive()) { + WRITELOG( "CHarvesterClientAO::Active - calling RegisterHarvestComplete" ); iHarvesterClient.RegisterHarvestComplete(iURI, iStatus); + iCancelled = EFalse; SetActive(); } } @@ -157,10 +163,12 @@ } // if the request was not canceled or server is not terminated, Activating AO again - if ( status != KErrCancel && status != KErrServerTerminated && iObserver ) + if ( status != KErrCancel && status != KErrServerTerminated && iObserver && !iCancelled ) { + WRITELOG( "CHarvesterClientAO::RunL() - not cancelled or terminated, calling Active" ); Active(); } + WRITELOG( "CHarvesterClientAO::RunL() - end" ); } // --------------------------------------------------------------------------- @@ -177,3 +185,24 @@ return KErrNone; } + +// --------------------------------------------------------------------------- +// Active +// --------------------------------------------------------------------------- +// +void CHarvesterClientAO::CancelRequest() + { + WRITELOG( "CHarvesterClientAO::CancelRequest" ); + if( !iCancelled ) + { + WRITELOG( "CHarvesterClientAO::CancelRequest - not cancelled, calling Cancel" ); + iCancelled = ETrue; + Cancel(); + } + if( !IsActive() ) + { + WRITELOG( "CHarvesterClientAO::CancelRequest - setting priority to High" ); + SetPriority( CActive::EPriorityHigh ); + } + } + diff -r b73252188534 -r f23c07ec56e2 harvester/client/traces/fixed_id.definitions --- a/harvester/client/traces/fixed_id.definitions Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/client/traces/fixed_id.definitions Tue Aug 31 15:37:30 2010 +0300 @@ -4,6 +4,7 @@ [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_CONSTRUCTL=0x10 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_DOCANCEL=0x13 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_NEWL=0xd +[TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_REMOVEOBSERVER=0x15 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_RUNL=0x14 [TRACE]TRACE_NORMAL[0x3]_CHARVESTERCLIENTAO_SETOBSERVER=0x11 [TRACE]TRACE_NORMAL[0x3]_DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xf diff -r b73252188534 -r f23c07ec56e2 harvester/client/traces/harvesterclientaoTraces.h --- a/harvester/client/traces/harvesterclientaoTraces.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/client/traces/harvesterclientaoTraces.h Tue Aug 31 15:37:30 2010 +0300 @@ -13,6 +13,7 @@ #define CHARVESTERCLIENTAO_SETOBSERVER 0x30011 #define CHARVESTERCLIENTAO_DOCANCEL 0x30013 #define CHARVESTERCLIENTAO_RUNL 0x30014 +#define CHARVESTERCLIENTAO_REMOVEOBSERVER 0x30015 #endif diff -r b73252188534 -r f23c07ec56e2 harvester/common/bwincw/harvesterplugininterfacewinscw.def --- a/harvester/common/bwincw/harvesterplugininterfacewinscw.def Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/bwincw/harvesterplugininterfacewinscw.def Tue Aug 31 15:37:30 2010 +0300 @@ -13,4 +13,5 @@ ?GetMimeType@CHarvesterPlugin@@UAEXABVTDesC16@@AAVTDes16@@@Z @ 12 NONAME ; void CHarvesterPlugin::GetMimeType(class TDesC16 const &, class TDes16 &) ?SetHarvesterPluginFactory@CHarvesterPlugin@@QAEXAAVCHarvesterPluginFactory@@@Z @ 13 NONAME ; void CHarvesterPlugin::SetHarvesterPluginFactory(class CHarvesterPluginFactory &) ?PluginInIdleState@CHarvesterPlugin@@QAEHXZ @ 14 NONAME ; int CHarvesterPlugin::PluginInIdleState(void) + ?StopHarvest@CHarvesterPlugin@@UAEXXZ @ 15 NONAME ; void CHarvesterPlugin::StopHarvest(void) diff -r b73252188534 -r f23c07ec56e2 harvester/common/eabi/harvesterplugininterfacearm.def --- a/harvester/common/eabi/harvesterplugininterfacearm.def Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/eabi/harvesterplugininterfacearm.def Tue Aug 31 15:37:30 2010 +0300 @@ -17,4 +17,5 @@ _ZN16CHarvesterPlugin11GetMimeTypeERK7TDesC16R6TDes16 @ 16 NONAME _ZN16CHarvesterPlugin25SetHarvesterPluginFactoryER23CHarvesterPluginFactory @ 17 NONAME _ZN16CHarvesterPlugin17PluginInIdleStateEv @ 18 NONAME + _ZN16CHarvesterPlugin11StopHarvestEv @ 19 NONAME diff -r b73252188534 -r f23c07ec56e2 harvester/common/inc/harvestercommon.h --- a/harvester/common/inc/harvestercommon.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/inc/harvestercommon.h Tue Aug 31 15:37:30 2010 +0300 @@ -107,9 +107,8 @@ // Between Standard and UserInput to allow components to react to important events correctly const TInt KHarvesterCustomImportantPriority = 5; -// Higher than MonitorPlugin priority but lower than High to ensure server can answer to all -// connection requests as fast as possible -const TInt KHarvesterServerSessionPriority = 11; +// Higher than MonitorPlugin priority but lower than High. Highest priority within Harvester +const TInt KHarvesterServerHighPriority = 11; #endif diff -r b73252188534 -r f23c07ec56e2 harvester/common/inc/harvesterpluginfactory.h --- a/harvester/common/inc/harvesterpluginfactory.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/inc/harvesterpluginfactory.h Tue Aug 31 15:37:30 2010 +0300 @@ -61,6 +61,9 @@ TBool iHarvesting; CHarvesterEventManager* iHarvesterEventManager; + + HBufC* iLastConfirmedContainerExt; + HBufC* iLastConfirmedSupportedExt; }; #endif diff -r b73252188534 -r f23c07ec56e2 harvester/common/src/harvesterexifutil.cpp --- a/harvester/common/src/harvesterexifutil.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/src/harvesterexifutil.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -433,7 +433,7 @@ EXPORT_C TTime CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL( const TDesC8& aDateTime ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL()" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL()" ); OstTrace0( TRACE_NORMAL, CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL" ); TDateTime datetime( 0, EJanuary, 0, 0, 0, 0, 0 ); @@ -446,7 +446,7 @@ TInt error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get year" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get year" ); OstTrace0( TRACE_NORMAL, DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get year" ); User::Leave( error ); @@ -459,7 +459,7 @@ error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get month" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get month" ); OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get month" ); User::Leave( error ); @@ -474,7 +474,7 @@ error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get date" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get date" ); OstTrace0( TRACE_NORMAL, DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get date" ); User::Leave( error ); @@ -487,7 +487,7 @@ error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get hours" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get hours" ); OstTrace0( TRACE_NORMAL, DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get hours" ); User::Leave( error ); @@ -500,7 +500,7 @@ error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get minutes" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get minutes" ); OstTrace0( TRACE_NORMAL, DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get minutes" ); User::Leave( error ); @@ -513,7 +513,7 @@ error = lex.Val( number ); if ( error != KErrNone ) { - WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get seconds" ); + WRITELOG( "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL() - couldn't get seconds" ); OstTrace0( TRACE_NORMAL, DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get seconds" ); User::Leave( error ); @@ -829,7 +829,9 @@ WRITELOG( "CHarvesterExifUtil::ComposeExifData() - Image doesn't contain EXIF data" ); modifyExif = CExifModify::NewL( aImagePtr, CExifModify::ECreate, CExifModify::ENoJpegParsing ); + CleanupStack::PushL( modifyExif ); SetExifDefaultsL( aMdeObject, *modifyExif ); + CleanupStack::Pop( modifyExif ); exifChanged = ETrue; } CleanupStack::PushL( modifyExif ); diff -r b73252188534 -r f23c07ec56e2 harvester/common/src/harvesterplugin.cpp --- a/harvester/common/src/harvesterplugin.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/src/harvesterplugin.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -65,7 +65,8 @@ iDtor_ID_Key( KNullUid ), iOriginPropertyDef( NULL ), iTitlePropertyDef( NULL ), - iHarvesting( EFalse ) + iHarvesting( EFalse ), + iPaused( EFalse ) { } @@ -109,6 +110,7 @@ { if( iState == EHarvesterIdle ) { + iPaused = EFalse; SetNextRequest( EHarvesterGathering ); } } @@ -154,6 +156,7 @@ } else { + WRITELOG( "CHarvesterPlugin::RunL EHarvesterGathering - items in queue" ); if ( !iHarvesting ) { TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( ETrue ) ); @@ -244,12 +247,28 @@ } // --------------------------------------------------------------------------- +// StartHarvest +// --------------------------------------------------------------------------- +// +EXPORT_C void CHarvesterPlugin::StopHarvest() + { + Cancel(); + iState = EHarvesterIdle; + if( iHarvesting ) + { + TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( EFalse ) ); + iHarvesting = EFalse; + } + iPaused = ETrue; + } + +// --------------------------------------------------------------------------- // SetNextRequest // --------------------------------------------------------------------------- // void CHarvesterPlugin::SetNextRequest( THarvesterState aState ) { - if ( ! IsActive() ) + if ( !IsActive() && !iPaused ) { iState = aState; SetActive(); diff -r b73252188534 -r f23c07ec56e2 harvester/common/src/harvesterpluginfactory.cpp --- a/harvester/common/src/harvesterpluginfactory.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/src/harvesterpluginfactory.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -68,6 +68,12 @@ { WRITELOG( "CHarvesterPluginFactory::~CHarvesterPluginFactory()" ); + delete iLastConfirmedContainerExt; + iLastConfirmedContainerExt = NULL; + + delete iLastConfirmedSupportedExt; + iLastConfirmedSupportedExt = NULL; + if (iHarvesterEventManager) { iHarvesterEventManager->ReleaseInstance(); @@ -330,6 +336,13 @@ TPtrC extPtr; if( MdsUtils::GetExt( aFileName, extPtr ) ) { + if( iLastConfirmedSupportedExt && + extPtr.CompareF( iLastConfirmedSupportedExt->Des() ) == 0 ) + { + // Extension has previously been confirmed to be + // supported file extension, no need to ask from plugins + return ETrue; + } TInt pluginInfoCount = iHarvesterPluginInfoArray.Count(); TInt extCount = 0; for ( TInt i = pluginInfoCount; --i >= 0; ) @@ -343,6 +356,9 @@ TInt result = MdsUtils::Compare( *ext, extPtr ); if ( result == 0 ) { + delete iLastConfirmedSupportedExt; + iLastConfirmedSupportedExt = NULL; + iLastConfirmedSupportedExt = extPtr.Alloc(); return ETrue; } } @@ -358,6 +374,14 @@ if( MdsUtils::GetExt( aURI, extPtr ) ) { + if( iLastConfirmedContainerExt && + extPtr.CompareF( iLastConfirmedContainerExt->Des() ) == 0 ) + { + // Extension has previously been confirmed to be + // container file extension, no need to ask from plugins + return ETrue; + } + RPointerArray supportedPlugins; CleanupClosePushL( supportedPlugins ); GetSupportedPluginsL( supportedPlugins, extPtr ); @@ -367,6 +391,9 @@ if( info->iObjectTypes.Count() > 1 ) { isContainerFile = ETrue; + delete iLastConfirmedContainerExt; + iLastConfirmedContainerExt = NULL; + iLastConfirmedContainerExt = extPtr.Alloc(); break; } } @@ -395,6 +422,7 @@ EXPORT_C void CHarvesterPluginFactory::SendHarvestingStatusEventL( TBool aStarted ) { + WRITELOG( "CHarvesterPluginFactory::SendHarvestingStatusEventL" ); const TInt pluginInfoCount = iHarvesterPluginInfoArray.Count(); TBool itemsLeft( EFalse ); TBool allPluginsOnIdle( ETrue ); @@ -418,6 +446,7 @@ if( !iHarvesting && itemsLeft && aStarted ) { + WRITELOG( "CHarvesterPluginFactory::SendHarvestingStatusEventL - overall started" ); iHarvesting = ETrue; iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateStarted ); // This next line is for caching the harvester started event for observers registering @@ -427,6 +456,7 @@ } else if( iHarvesting && (!itemsLeft || allPluginsOnIdle) && !aStarted ) { + WRITELOG( "CHarvesterPluginFactory::SendHarvestingStatusEventL - overall finished" ); iHarvesting = EFalse; iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateFinished ); iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeOverall, KCacheItemCountForEventCaching ); @@ -440,7 +470,7 @@ { if( iHarvesterPluginInfoArray[i]->iPlugin && aPaused ) { - iHarvesterPluginInfoArray[i]->iPlugin->Cancel(); + iHarvesterPluginInfoArray[i]->iPlugin->StopHarvest(); } else if( iHarvesterPluginInfoArray[i]->iPlugin ) { @@ -481,6 +511,8 @@ info->iPlugin->SetBlacklist( *iBlacklist ); } info->iPlugin->GetObjectType( aHD->Uri(), aObjectDef ); + // It is possible for unmount to occure while we are waiting + // for GetObjectType to return, thus check aHD for validity if( aHD && aObjectDef.Length() > 0 ) { aHD->SetHarvesterPluginInfo( info ); diff -r b73252188534 -r f23c07ec56e2 harvester/common/src/mdeobjectwrapper.cpp --- a/harvester/common/src/mdeobjectwrapper.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/common/src/mdeobjectwrapper.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -157,7 +157,7 @@ case EPropertyReal32: { TReal32* value = static_cast( aData ); - WRITELOG2("CMdeObjectWrapper::HandleObjectPropertyL - Edit property: %S with value %d", &aPropertyDef.Name(), *value ); + WRITELOG2("CMdeObjectWrapper::HandleObjectPropertyL - Edit property: %S with value %f", &aPropertyDef.Name(), *value ); property->SetReal32ValueL( *value ); } break; @@ -173,9 +173,7 @@ case EPropertyTime: { TTime* value = static_cast( aData ); -#ifdef _DEBUG - WRITELOG2("CMdeObjectWrapper::HandleObjectPropertyL - Edit property: %S with value %d", &aPropertyDef.Name(), value->Int64() ); -#endif + WRITELOG2("CMdeObjectWrapper::HandleObjectPropertyL - Edit property: %S with value %u", &aPropertyDef.Name(), value->Int64() ); property->SetTimeValueL( *value ); } break; diff -r b73252188534 -r f23c07ec56e2 harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp --- a/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/composerplugins/imagecomposer/src/imagecomposerao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -275,7 +275,7 @@ SetNextRequest( ERequestCompose ); } - // if object does not exists, find next + // if object does not exists, or data is not modified, find next else if ( err == KErrNotFound || err == KErrAbort ) { if ( err == KErrAbort && mdeObjectId != KNoId ) @@ -423,6 +423,7 @@ if( error != KErrNone || entry.iModified == time ) { + WRITELOG( "CImageComposerAO::GetObjectFromMdeL() - image data has not been modified - abort" ); User::Leave( KErrAbort ); } } diff -r b73252188534 -r f23c07ec56e2 harvester/composerplugins/imagecomposer/src/imagepresentobserver.cpp --- a/harvester/composerplugins/imagecomposer/src/imagepresentobserver.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/composerplugins/imagecomposer/src/imagepresentobserver.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -87,8 +87,10 @@ void CImagePresentObserver::HandleObjectPresentNotification(CMdESession& /*aSession*/, TBool aPresent, const RArray& aObjectIdArray) { + WRITELOG( "CImagePresentObserver::HandleObjectPresentNotification" ); if ( aPresent ) { + WRITELOG( "CImagePresentObserver::HandleObjectPresentNotification - objects present" ); if ( !iStarted ) { CMdEObjectDef* imageObjDef = NULL; diff -r b73252188534 -r f23c07ec56e2 harvester/data/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/data/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2010 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: Build information file +* +*/ + + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS +blacklist_backup_registration.xml /epoc32/winscw/c/private/200009F5/backup_registration.xml +blacklist_backup_registration.xml /epoc32/data/z/private/200009F5/backup_registration.xml +default_origin_mappings.db /epoc32/winscw/c/private/200009F5/mappings.db +default_origin_mappings.db /epoc32/data/z/private/200009F5/mappings.db +../conf/harvester.confml MW_LAYER_CONFML(harvester.confml) +../conf/harvester_200009FE.crml MW_LAYER_CRML(harvester_200009FE.crml) + +../sis/blacklistserver/blacklistserver_stub.sis /epoc32/data/z/system/install/blacklistserver_stub.sis +../sis/composerplugins/composerplugins_stub.sis /epoc32/data/z/system/install/composerplugins_stub.sis +../sis/harvester/harvester_stub.sis /epoc32/data/z/system/install/harvester_stub.sis +../sis/harvesterplugins/harvesterplugins_stub.sis /epoc32/data/z/system/install/harvesterplugins_stub.sis +../sis/monitorplugins/monitorplugins_stub.sis /epoc32/data/z/system/install/monitorplugins_stub.sis + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + + +PRJ_TESTEXPORTS diff -r b73252188534 -r f23c07ec56e2 harvester/group/bld.inf --- a/harvester/group/bld.inf Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/group/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -25,27 +25,16 @@ #include "../server/group/bld.inf" #include "../client/group/bld.inf" +#include "../data/bld.inf" PRJ_PLATFORMS DEFAULT PRJ_EXPORTS -../data/blacklist_backup_registration.xml /epoc32/winscw/c/private/200009F5/backup_registration.xml -../data/blacklist_backup_registration.xml /epoc32/data/z/private/200009F5/backup_registration.xml -../data/default_origin_mappings.db /epoc32/winscw/c/private/200009F5/mappings.db -../data/default_origin_mappings.db /epoc32/data/z/private/200009F5/mappings.db -../conf/harvester.confml MW_LAYER_CONFML(harvester.confml) -../conf/harvester_200009FE.crml MW_LAYER_CRML(harvester_200009FE.crml) - -../sis/blacklistserver/blacklistserver_stub.sis /epoc32/data/z/system/install/blacklistserver_stub.sis -../sis/composerplugins/composerplugins_stub.sis /epoc32/data/z/system/install/composerplugins_stub.sis -../sis/harvester/harvester_stub.sis /epoc32/data/z/system/install/harvester_stub.sis -../sis/harvesterplugins/harvesterplugins_stub.sis /epoc32/data/z/system/install/harvesterplugins_stub.sis -../sis/monitorplugins/monitorplugins_stub.sis /epoc32/data/z/system/install/monitorplugins_stub.sis PRJ_MMPFILES PRJ_TESTMMPFILES +PRJ_TESTEXPORTS -PRJ_TESTEXPORTS diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/data/200211F5.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/data/200211F5.rss Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +// 1F2F3F4F.RSS + +#include "registryinfov2.rh" + +// Declares info for one test implementation +RESOURCE REGISTRY_INFO theInfo + { + + // resource_format_version must always be set as follows + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + // UID for the DLL + dll_uid = 0x200211F5; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x200009F8; + implementations = + { + // Info for CHarvesterVideoPlugin + IMPLEMENTATION_INFO + { + implementation_uid = 0x200211F6; + version_no = 1; + display_name = "Harvester audio playlist plugin"; + default_data = "Album"; + opaque_data = "m3u"; + rom_only = 0; + } + }; + } + }; + } + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/data/mdsplaylisttopcharacterset.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/data/mdsplaylisttopcharacterset.rss Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,787 @@ +/* +* Copyright (c) 2009 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: Resource file. +* +*/ + + +// INCLUDES +#include +#include +#include "mdsplaylisttopcharacterset.rh" +#include "mdsplaylistsupplementalcharsets.hrh" + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// Resource : r_mds_playlist_albanian_char_set +// Description : Albanian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_albanian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso88592 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_arabic_char_set +// Description : Arabic character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_arabic_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88596, + // windows 1256 + KCharacterSetIdentifierCp1256 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_bosnian_char_set +// Description : Bosnian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_bosnian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_bulgarian_char_set +// Description : Bulgarian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_bulgarian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88595, + // Windows 1251 + KCharacterSetIdentifierCp1251 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_taiwan_hk_chinese_char_set +// Description : Taiwan HongKong Chinese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_taiwan_hk_chinese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierBig5 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_chinese_char_set +// Description : Chinese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_chinese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierGb2312, + KCharacterSetIdentifierGbk + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_croatian_char_set +// Description : Croatian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_croatian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_czech_char_set +// Description : Czech character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_czech_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_danish_char_set +// Description : Danish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_danish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_dutch_char_set +// Description : Dutch character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_dutch_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_english_char_set +// Description : English character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_english_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierAscii, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_estonian_char_set +// Description : Estonian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_estonian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso88594, + KCharacterSetIdentifierIso885910, + KCharacterSetIdentifierIso885913, + // windows 1257 + KCharacterSetIdentifierCp1257 + + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_farsi_char_set +// Description : Farsi character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_farsi_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88596, + // Windows-1256 + KCharacterSetIdentifierCp1256 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_finnish_char_set +// Description : Finnish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_finnish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_french_char_set +// Description : English character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_french_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_german_char_set +// Description : German character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_german_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + + +//---------------------------------------------------- +// Resource : r_mds_playlist_greek_char_set +// Description : Greek character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_greek_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88597, + // windows 1253 + KCharacterSetIdentifierCp1253 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_hebrew_char_set +// Description : Hebrew character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_hebrew_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88598, + // windows 1255 + KCharacterSetIdentifierCp1255 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_hungarian_char_set +// Description : Hungarian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_hungarian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_icelandic_char_set +// Description : Icelandic character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_icelandic_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso88599, + KCharacterSetIdentifierIso885915, + // windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_indian_char_set +// Description : Indian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_indian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + // ISCII + KCharacterSetIdentifierISCII + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_indonesian_char_set +// Description : Indonesian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_indonesian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierAscii, + KCharacterSetIdentifierIso88591, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_irish_char_set +// Description : Irish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_irish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885914 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_italian_char_set +// Description : Italian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_italian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + + +//---------------------------------------------------- +// Resource : r_mds_playlist_japanese_char_set +// Description : Japanese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_japanese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierShiftJis, + KCharacterSetIdentifierIso2022Jp, + KCharacterSetIdentifierEucJpPacked + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_latvian_char_set +// Description : Latvian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_latvian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88594, + KCharacterSetIdentifierIso885910, + KCharacterSetIdentifierIso885913, + // Windows 1257 + KCharacterSetIdentifierCp1257 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_lithuanian_char_set +// Description : Lithuanian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_lithuanian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88594, + KCharacterSetIdentifierIso885910, + KCharacterSetIdentifierIso885913, + // Windows 1257 + KCharacterSetIdentifierCp1257 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_malay_char_set +// Description : Malay character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_malay_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierAscii, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_maltese_char_set +// Description : Maltese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_maltese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88593 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_norwegian_char_set +// Description : Norwegian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_norwegian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_pilipino_char_set +// Description : Pilipino character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_pilipino_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_polish_char_set +// Description : Polish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_polish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // Windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_portuguese_char_set +// Description : Portuguese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_portuguese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_romanian_char_set +// Description : Romanian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_romanian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // Windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_russian_char_set +// Description : Russian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_russian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88595, + // Windows 1251 + KCharacterSetIdentifierCp1251, + // KOI8-R + KCharacterSetIdentifierKOI8R + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_sami_char_set +// Description : Sami character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_sami_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88594, + KCharacterSetIdentifierIso885910 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_serbian_char_set +// Description : Serbian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_serbian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + KCharacterSetIdentifierIso88595, + // Windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_slovak_char_set +// Description : Slovak character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_slovak_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // Windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_slovenian_char_set +// Description : Slovenian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_slovenian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88592, + // Windows 1250 + KCharacterSetIdentifierCp1250 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_spanish_char_set +// Description : Spanish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_spanish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + + +//---------------------------------------------------- +// Resource : r_mds_playlist_swedish_char_set +// Description : Swedish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_swedish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88591, + KCharacterSetIdentifierIso885915, + // Windows 1252 + KCharacterSetIdentifierCp1252 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_thai_char_set +// Description : Thai character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_thai_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + // TIS-620 + KCharacterSetIdentifierTIS620, + // Windows-874 + KCharacterSetIdentifierCp874 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_turkish_char_set +// Description : Turkish character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_turkish_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88593, + // Windows 1254 + KCharacterSetIdentifierCp1254 + }; + } + + +//---------------------------------------------------- +// Resource : r_mds_playlist_ukrainian_char_set +// Description : Ukrainian character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_ukrainian_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88595, + // KOI8-U + KCharacterSetIdentifierKOI8U + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_urdu_char_set +// Description : Urdu character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_urdu_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + KCharacterSetIdentifierIso88595, + KCharacterSetIdentifierIso88596, + // Windows-1256 + KCharacterSetIdentifierCp1256 + }; + } + +//---------------------------------------------------- +// Resource : r_mds_playlist_vietnamese_char_set +// Description : Vietnamese character sets +//---------------------------------------------------- +// +RESOURCE MDS_PLAYLIST_CHARACTER_SET_ENCODING r_mds_playlist_vietnamese_char_set + { + character_set_id = + { + KCharacterSetIdentifierUtf8, + // Windows-1258 + KCharacterSetIdentifierCp1258 + }; + } + +// End of File + + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/group/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +#include + +PRJ_PLATFORMS + DEFAULT + +PRJ_MMPFILES +harvesteraudioplaylistplugin.mmp + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/group/harvesteraudioplaylistplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/group/harvesteraudioplaylistplugin.mmp Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +#include +#include + +CAPABILITY CAP_ECOM_PLUGIN + +TARGET harvesteraudioplaylistplugin.dll +TARGETTYPE PLUGIN + +// ECom Dll recognition UID followed by the unique UID for this dll +UID 0x10009D8D 0x200211F5 + +START RESOURCE ../data/200211F5.rss +TARGET harvesteraudioplaylistplugin.rsc +END + +START RESOURCE ../data/mdsplaylisttopcharacterset.rss +HEADER +TARGET mdsplaylisttopcharacterset.rsc +TARGETPATH RESOURCE_FILES_DIR +END + +USERINCLUDE ../../../../inc +USERINCLUDE ../../../common/inc +USERINCLUDE ../inc + +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/connect + +SOURCEPATH ../src +SOURCE harvesteraudioplaylistplugin.cpp +SOURCE proxy.cpp +SOURCE harvesterm3uplaylistparser.cpp +SOURCE harvesteraudioplaylistparser.cpp + +// Default system include paths for middleware layer modules. +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY apmime.lib // TDataType +LIBRARY bafl.lib //BaflUtils + +LIBRARY harvesterplugininterface.lib +LIBRARY mdeclient.lib +LIBRARY harvesterdata.lib +LIBRARY harvestercommon.lib +LIBRARY syslangutil.lib +LIBRARY charconv.lib +LIBRARY platformenv.lib + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesteraudioplaylistparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesteraudioplaylistparser.h Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2009 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 __CHARVESTERAUDIOPLAYLISTPARSER_H__ +#define __CHARVESTERAUDIOPLAYLISTPARSER_H__ + +#include +#include + +#include "harvesterm3uplaylistparser.h" + +// +// CAudioMDParser +// +class CHarvesterAudioPlaylistParser : public CBase + { + public: + static CHarvesterAudioPlaylistParser* NewL(); + virtual ~CHarvesterAudioPlaylistParser(); + + TBool ParseMimeType( const TDesC& aFileName, TDes& aMimeType ); + TBool ParseL( const TDesC& aFileName, RPointerArray& aUriArray, TPtrC aMimeType ); + void Reset(); + + private: + CHarvesterAudioPlaylistParser(); + void ConstructL(); + + /** + * Generate to character sets based on locale. + */ + void GenerateTopCharacterSetsL(); + + /** + * Select character set(s) for the specified language. + * @param aLanguage language to select character sets for + */ + void SelectCharacterSetsForLanguageL( TInt aLanguage ); + + /** + * reads the character set for the specified resource. + * @param aResourceId id of the resource to read from the resource file + */ + void ReadCharacterSetResourceL( TInt aResourceId ); + + /** + * Determine whether the given character set is specified + * as top character set. + * @param aCharacterSetId id of the character set to be tested + */ + TBool IsInTopCharacterSet( TUint aCharacterSetId ); + + private: + RFs iFs; + + CArrayFix* iTopCharacterSet; + CArrayFix* iAvailableCharacterSet; + + RResourceFile iRscFile; + + CHarvesterM3UPlaylistParser* iM3UParser; + }; + + + +#endif // __CHARVESTERAUDIOPLAYLISTPARSER_H__ + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesteraudioplaylistplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesteraudioplaylistplugin.h Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 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 __CHARVESTERAUDIOPLAYLISTPLUGIN_H__ +#define __CHARVESTERAUDIOPLAYLISTPLUGIN_H__ + +#include +#include +#include +#include +#include +#include +#include "harvesteraudioplaylistparser.h" + +class CHarvestData; + +/** + * Helper class to hold all property definitions + * (pointers are not owned) used in harvester audio plug-in. + */ +class CHarvesterAudioPlaylistPluginPropertyDefs : public CBase + { + public: + // Common property definitions + CMdEPropertyDef* iCreationDatePropertyDef; + CMdEPropertyDef* iLastModifiedDatePropertyDef; + CMdEPropertyDef* iSizePropertyDef; + CMdEPropertyDef* iItemTypePropertyDef; + CMdEPropertyDef* iTitlePropertyDef; + + CMdEPropertyDef* iAlbumTypeDef; + + CMdEPropertyDef* iAlbumIDDef; + CMdEPropertyDef* iAudioObjectIDDef; + CMdEPropertyDef* iPositionDef; + + private: + CHarvesterAudioPlaylistPluginPropertyDefs(); + + void ConstructL(CMdEObjectDef& aObjectDef); + + public: + static CHarvesterAudioPlaylistPluginPropertyDefs* NewL(CMdEObjectDef& aObjectDef); + }; + + +class CHarvesterAudioPlaylistPlugin : public CHarvesterPlugin + { + public: + /** + * Construction + * @return Harvester audio plugin + */ + static CHarvesterAudioPlaylistPlugin* NewL(); + + /** + * Destruction + */ + virtual ~CHarvesterAudioPlaylistPlugin(); + + private: + // Default constructor + CHarvesterAudioPlaylistPlugin(); + + // 2nd phase constructor + void ConstructL(); + + + public: // from CHarvesterPlugin + + /** + * Harvesting multiple files + * @param aHarvesterData CHarvesterData datatype containing needed harvest data + * @return None + */ + void HarvestL( CHarvesterData* aHD ); + + private: + + /** + * Harvesting multiple files + * @param aHarvesterData CHarvesterData datatype containing needed harvest data + * + */ + void DoHarvestL( CHarvesterData* aHD ); + + /** + * Handles creation of new mde objects. + */ + void GetPropertiesL( CHarvesterData* aHarvesterData, TBool aIsAdd ); + + /** + * Get placeholder properties (creation time, modify time and file size). + */ + void GetPlaceHolderPropertiesL( CHarvesterData* aHD, TBool aIsAdd ); + + /** + * Get media file mime type (eg. "audio/mp3"). + */ + TBool GetMimeTypePropertyL( CHarvesterData* aHD, TBool aIsAdd ); + + /** + * Get song name, artist, album, genre and composer from normal music + * file (eg. mp3). + */ + void GetMusicPropertiesL( CHarvesterData* aHD, TBool aIsAdd ); + + private: + CHarvesterAudioPlaylistParser* iPlaylistParser; + HBufC* iMime; + + CHarvesterAudioPlaylistPluginPropertyDefs* iPropDefs; + + TInt iError; + }; + + +#endif // __CHARVESTERAUDIOPLAYLISTPLUGIN_H__ + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesterm3uplaylistparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/harvesterm3uplaylistparser.h Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 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 __CHARVESTERM3UPLAYLISTPARSER_H__ +#define __CHARVESTERM3UPLAYLISTPARSER_H__ + +#include + +// +// CAudioMDParser +// +class CHarvesterM3UPlaylistParser : public CBase + { + public: + static CHarvesterM3UPlaylistParser* NewL( RFs& aFs, + CArrayFix* aAvailableCharacterSet, + CArrayFix* aTopCharacterSet ); + virtual ~CHarvesterM3UPlaylistParser(); + + TBool ParseL( const TDesC& aFileName, RPointerArray& aUriArray ); + void Reset(); + + private: + CHarvesterM3UPlaylistParser( RFs& aFs, + CArrayFix* aAvailableCharacterSet, + CArrayFix* aTopCharacterSet ); + + /** + * Reads data from playlist file to the buffer + */ + void ReadPlaylistFileToBufferL(); + + /** + * Parses the buffer where playlist file was read to. + */ + void ParsePlaylistBufferL( + RPointerArray& aPlaylist, + TInt& aInvalidItemCount); + + /** + * Auto detects the character encoding from the supplied character + * set + * @param aSample a sample of the file + * @param aCharSetId auto-detected character set for the supplied + * sample + * @param aCharacterSet a character set to detect the encoding from + * @return KErrNone if a character set is found; otherwise + * KErrNotFound. + */ + TInt DetectCharacterSetL( + const TDesC8& aSample, + const CArrayFix& aCharacterSet, + TUint& aCharSetId ); + + /** + * Reads next line from iBuffer and stores it to iLine. Returns EFalse + * if there are no more new lines. + */ + TBool ReadNextLineL(); + + /** + * Decides what to do with an iLine read from iBuffer + */ + void ProcessLineL( + RPointerArray& aPlaylist, + TInt& aInvalidItemCount); + + /** + * Parses path or extended info from an iLine and stores them to iItem + */ + TInt ParseLineL( + TFileName& aItem, + TInt& aInvalidItemCount); + + /** + * Parses and returns an absolute path if aPath is relative to playlist + * file's path. If path is not valid or it doesn't exist, error code is + * returned in aError. + * + * caller assumes ownership of the returned HBufC + */ + HBufC* ParseAbsolutePathLC( + const TDesC& aPath, + TInt& aError); + + private: + RFs& iFs; + + TPtrC iPlaylistFilePath; + + TInt iInvalidItems; + + HBufC* iBuffer; + TPtrC iBufferPtr; + + // Not owned. + CArrayFix* iAvailableCharacterSet; + CArrayFix* iTopCharacterSet; + + TInt iEndLineNumber; + TInt iCurrentLineNumber; + + HBufC* iLine; + + TBool iExtendedFormat; + + TFileName iItem; + }; + + + +#endif // __CHARVESTERM3UPLAYLISTPARSER_H__ + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylistcharacterset.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylistcharacterset.hrh Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2009 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: All needed character set IDs are included here +* +*/ + + + +#ifndef __MDSPLAYLISTCHARACTERSET_HRH__ +#define __MDSPLAYLISTCHARACTERSET_HRH__ + +// INCLUDES + +/** +UTF-7 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierUtf7 0x1000582c +/** +UTF-8 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierUtf8 0x1000582d +/** +IMAP UTF-7 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierImapUtf7 0x1000582e +/** +Java UTF-8 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierJavaConformantUtf8 0x1000582f +/** +Code Page 1252 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierCodePage1252 0x100012b6 +/** +ISO 8859-1 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88591 0x10003b10 +/** +ISO 8859-2 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88592 0x1000507e +/** +ISO 8859-3 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88593 0x10008a28 +/** +ISO 8859-4 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88594 0x1000507f +/** +ISO 8859-5 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88595 0x10005080 +/** +ISO 8859-6 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88596 0x10008a29 +/** +ISO 8859-7 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88597 0x10005081 +/** +ISO 8859-8 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88598 0x10008a2a +/** +ISO 8859-9 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso88599 0x10005082 +/** +ISO 8859-10 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso885910 0x10008a2b +/** +ISO 8859-13 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso885913 0x10008a2c +/** +ISO 8859-14 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso885914 0x10008a2d +/** +ISO 8859-15 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso885915 0x10008a2e +/** +ASCII +@publishedAll +@released +*/ +#define KCharacterSetIdentifierAscii 0x10004cc6 +/** +SMS 7-bit +@publishedAll +@released +*/ +#define KCharacterSetIdentifierSms7Bit 0x100053ab +/** +GB 2312 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierGb2312 0x10000fbe +/** +HZ-GB-2312 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierHz 0x10006065 +/** +GB 12345 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierGb12345 0x1000401a +/** +GBK +@publishedAll +@released +*/ +#define KCharacterSetIdentifierGbk 0x10003ecb +/** +Big 5 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierBig5 0x10000fbf +/** +Shift-JIS +@publishedAll +@released +*/ +#define KCharacterSetIdentifierShiftJis 0x10000fbd +/** +ISO-2022-JP +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso2022Jp 0x100066a0 +/** +ISO-2022-JP-1 +@publishedAll +@released +*/ +#define KCharacterSetIdentifierIso2022Jp1 0x100066a3 +/** +JIS Encoding +@publishedAll +@released +*/ +#define KCharacterSetIdentifierJis 0x10006066 +/** +EUC-JP +@publishedAll +@released +*/ +#define KCharacterSetIdentifierEucJpPacked 0x10006067 +#define KCharacterSetIdentifierUnicodeLittle 0x101f3fae //Little Endian Unicode +#define KCharacterSetIdentifierUnicodeBig 0x101f4052 // Big Endian Unicode +#define KCharacterSetIdentifierUcs2 0x101ff492 + +#define KCharacterSetIdentifierWindows874 0x101F854A +#endif // __MDSPLAYLISTCHARACTERSET_HRH__ + + +// End of File diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylistsupplementalcharsets.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylistsupplementalcharsets.hrh Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2007 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: supplemental character set IDs are included here +* +*/ + + +#ifndef __MDSPLAYLISTSUPPLEMENTALCHARSET_HRH__ +#define __MDSPLAYLISTSUPPLEMENTALCHARSET_HRH__ + +/** +EucJpDirectmap +*/ +#define KCharacterSetIdentifierEucJpDirectmap 0x10207353 +/** +ShiftJisDirectmap +*/ +#define KCharacterSetIdentifierShiftJisDirectmap 0x10207354 +/** +KOI8-R +*/ +#define KCharacterSetIdentifierKOI8R 0x10207401 +/** +KOI8-U +*/ +#define KCharacterSetIdentifierKOI8U 0x10207402 +/** +TIS_620 +*/ +#define KCharacterSetIdentifierTIS620 0x10207403 +/** +Windows-1250 +*/ +#define KCharacterSetIdentifierCp1250 0x10207404 +/** +Windows-1251 +*/ +#define KCharacterSetIdentifierCp1251 0x10207405 +/** +Windows-1252 +*/ +#define KCharacterSetIdentifierCp1252 0x10207406 +/** +Windows-1253 +*/ +#define KCharacterSetIdentifierCp1253 0x10207407 +/** +Windows-1254 +*/ +#define KCharacterSetIdentifierCp1254 0x10207408 +/** +Windows-1255 +*/ +#define KCharacterSetIdentifierCp1255 0x10207409 +/** +Windows-1256 +*/ +#define KCharacterSetIdentifierCp1256 0x1020740A +/** +Windows-1257 +*/ +#define KCharacterSetIdentifierCp1257 0x1020740B +/** +Windows-1258 +*/ +#define KCharacterSetIdentifierCp1258 0x1020740C +/** +Windows-874 +*/ +#define KCharacterSetIdentifierCp874 0x1020740D +/** +ISCII +*/ +#define KCharacterSetIdentifierISCII 0x1027508D + +#endif // __MDSPLAYLISTSUPPLEMENTALCHARSET_HRH__ diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylisttopcharacterset.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/inc/mdsplaylisttopcharacterset.rh Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 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: Contains definitions for structures used in Top Character Set +* resource files. +* +*/ + + + +#ifndef __MDSPLAYLISTTOPCHARACTERSET_RH__ +#define __MDSPLAYLISTTOPCHARACTERSET_RH__ + +// INCLUDES +#include "mdsplaylistcharacterset.hrh" // Enumerations + +// STRUCTURE DEFINITIONS + +// ----------------------------------------------------------------------------- +// MDS_PLAYLIST_CHARACTER_SET +// Structure definition character encoding +// ----------------------------------------------------------------------------- +// +STRUCT MDS_PLAYLIST_CHARACTER_SET_ENCODING + { + LONG character_set_id[]; + } + +#endif // __MDSPLAYLISTTOPCHARACTERSET_RH__ + + +// End of File diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesteraudioplaylistparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesteraudioplaylistparser.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,382 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "harvesteraudioplaylistparser.h" + +#include "mdsutils.h" +#include "harvesterlog.h" + +_LIT( KMimeTypeM3U, "audio/x-mpegurl" ); +_LIT( KExtensionM3U, "m3u" ); + +_LIT( KMDSPlaylistCharacterSetRscFile, "mdsplaylisttopcharacterset.rsc" ); + +const TInt KMDSArrayGranularity = 12; + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::NewL +// ----------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistParser* CHarvesterAudioPlaylistParser::NewL() + { + CHarvesterAudioPlaylistParser* self = new ( ELeave ) CHarvesterAudioPlaylistParser(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistParser::~CHarvesterAudioPlaylistParser() + { + delete iTopCharacterSet; + + delete iAvailableCharacterSet; + + iFs.Close(); + } + + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::CHarvesterAudioPlaylistParser +// ----------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistParser::CHarvesterAudioPlaylistParser() + { + } + + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::ConstructL +// ----------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistParser::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + iAvailableCharacterSet = CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableL( iFs ); + iTopCharacterSet = + new (ELeave) CArrayFixFlat( KMDSArrayGranularity ); + GenerateTopCharacterSetsL(); + iM3UParser = CHarvesterM3UPlaylistParser::NewL( iFs, iAvailableCharacterSet, iTopCharacterSet ); + } + + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::ParseMimeType +// ----------------------------------------------------------------------------- +// +TBool CHarvesterAudioPlaylistParser::ParseMimeType( + const TDesC& aFileName, TDes& aMimeType ) + { + TPtrC ext; + if( MdsUtils::GetExt( aFileName, ext ) ) + { + if( ext == KExtensionM3U ) + { + aMimeType = KMimeTypeM3U; + return ETrue; + } + } + + aMimeType = KNullDesC; + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::ParseL +// ----------------------------------------------------------------------------- +// +TBool CHarvesterAudioPlaylistParser::ParseL( const TDesC& aFileName, + RPointerArray& aUriArray, TPtrC aMimeType ) + { + if( aMimeType == KMimeTypeM3U ) + { + return iM3UParser->ParseL( aFileName, aUriArray ); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::ResetL +// ----------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistParser::Reset() + { + iM3UParser->Reset(); + } + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::GenerateTopCharacterSetsL +// ----------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistParser::GenerateTopCharacterSetsL() + { + CArrayFixFlat* installedLanguages = NULL; + SysLangUtil::GetInstalledLanguages( installedLanguages ); + CleanupStack::PushL( installedLanguages ); + + TFileName fileName; + + TParsePtrC memory( PathInfo::RomRootPath() ); + fileName.Copy( memory.Drive() ); + fileName.Append( KDC_RESOURCE_FILES_DIR ); + fileName.Append( KMDSPlaylistCharacterSetRscFile ); + + TRAPD( err, iRscFile.OpenL( iFs, fileName ) ); + + // if there is no resource file, then there is no top character set list + if( err ) + { + CleanupStack::PopAndDestroy( installedLanguages ); + return; + } + + const TInt count( installedLanguages->Count() ); + for( TInt i=0; i < count; i++ ) + { + SelectCharacterSetsForLanguageL( (*installedLanguages)[i] ); + } + iTopCharacterSet->Compress(); + installedLanguages->Reset(); + CleanupStack::PopAndDestroy( installedLanguages ); + iRscFile.Close(); + } + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::SelectCharacterSetsForLanguageL +// ----------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistParser::SelectCharacterSetsForLanguageL( TInt aLanguage ) + { + switch( aLanguage ) + { + case ELangEnglish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ENGLISH_CHAR_SET ); + break; + case ELangFrench: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_FRENCH_CHAR_SET ); + break; + case ELangGerman: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_GERMAN_CHAR_SET ); + break; + case ELangTurkish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_TURKISH_CHAR_SET ); + break; + case ELangFinnish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_FINNISH_CHAR_SET ); + break; + case ELangSwedish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SWEDISH_CHAR_SET ); + break; + case ELangRussian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_RUSSIAN_CHAR_SET ); + break; + case ELangArabic: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ARABIC_CHAR_SET ); + break; + case ELangHebrew: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_HEBREW_CHAR_SET ); + break; + case ELangFarsi: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_FARSI_CHAR_SET ); + break; + case ELangItalian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ITALIAN_CHAR_SET ); + break; + case ELangPolish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_POLISH_CHAR_SET ); + break; + case ELangHungarian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_HUNGARIAN_CHAR_SET ); + break; + case ELangSpanish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SPANISH_CHAR_SET ); + break; + case ELangDutch: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_DUTCH_CHAR_SET ); + break; + case ELangPortuguese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_PORTUGUESE_CHAR_SET ); + break; + case ELangAmerican: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ENGLISH_CHAR_SET ); + break; + case ELangCanadianFrench: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_FRENCH_CHAR_SET ); + break; + case ELangBrazilianPortuguese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_PORTUGUESE_CHAR_SET ); + break; + case ELangLatinAmericanSpanish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SPANISH_CHAR_SET ); + break; + case ELangLatvian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_LATVIAN_CHAR_SET ); + break; + case ELangGreek: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_GREEK_CHAR_SET ); + break; + case ELangEstonian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ESTONIAN_CHAR_SET ); + break; + case ELangLithuanian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_LITHUANIAN_CHAR_SET ); + break; + case ELangRomanian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ROMANIAN_CHAR_SET ); + break; + case ELangUkrainian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_UKRAINIAN_CHAR_SET ); + break; + case ELangBulgarian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_BULGARIAN_CHAR_SET ); + break; + case ELangCroatian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_CROATIAN_CHAR_SET ); + break; + case ELangSerbian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SERBIAN_CHAR_SET ); + break; + case ELangIndonesian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_INDONESIAN_CHAR_SET ); + break; + case ELangMalay: + case ELangTagalog: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_MALAY_CHAR_SET ); + break; + case ELangIcelandic: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ICELANDIC_CHAR_SET ); + break; + case ELangDanish: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_DANISH_CHAR_SET ); + break; + case ELangNorwegian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_NORWEGIAN_CHAR_SET ); + break; + case ELangHindi: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_INDIAN_CHAR_SET ); + break; + case ELangUrdu: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_URDU_CHAR_SET ); + break; + case ELangCzech: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_CZECH_CHAR_SET ); + break; + case ELangSlovak: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SLOVAK_CHAR_SET ); + break; + case ELangSlovenian: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_SLOVENIAN_CHAR_SET ); + break; + case ELangTaiwanChinese: + case ELangHongKongChinese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_TAIWAN_HK_CHINESE_CHAR_SET ); + break; + case ELangPrcChinese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_CHINESE_CHAR_SET ); + break; + case ELangEnglish_Taiwan: + case ELangEnglish_Prc: + case ELangEnglish_Japan: + case ELangEnglish_Thailand: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_ENGLISH_CHAR_SET ); + break; + case ELangJapanese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_JAPANESE_CHAR_SET ); + break; + case ELangThai: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_THAI_CHAR_SET ); + break; + case ELangVietnamese: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_VIETNAMESE_CHAR_SET ); + break; + case ELangMalay_Apac: + ReadCharacterSetResourceL( R_MDS_PLAYLIST_MALAY_CHAR_SET ); + break; + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::ReadCharacterSetResourceL +// ----------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistParser::ReadCharacterSetResourceL( TInt aResourceId ) + { + TResourceReader rscReader; // Resource reader + HBufC8* rscBuf; // Buffer where resource is read + + rscBuf = iRscFile.AllocReadL( aResourceId ); + rscReader.SetBuffer( rscBuf ); + CleanupStack::PushL( rscBuf ); + + TUint characterSetElementId; + TInt numCharacterSetElements = rscReader.ReadInt16(); + TUint elemId; + CCnvCharacterSetConverter::SCharacterSet elem; + + for( TInt i = 0; i < numCharacterSetElements; i++ ) + { + characterSetElementId = rscReader.ReadInt32(); + const TInt count( iAvailableCharacterSet->Count() ); + for( TInt j = 0; j < count; j++ ) + { + elem = (*iAvailableCharacterSet)[j]; + elemId = elem.Identifier(); + if ( elemId == characterSetElementId && !IsInTopCharacterSet(characterSetElementId) ) + { + iTopCharacterSet->AppendL( elem ); + } + } + } + + CleanupStack::PopAndDestroy( rscBuf ); + } + +// ----------------------------------------------------------------------------- +// CHarvesterAudioPlaylistParser::IsInTopCharacterSet +// ----------------------------------------------------------------------------- +// +TBool CHarvesterAudioPlaylistParser::IsInTopCharacterSet( TUint aCharacterSetId ) + { + const TInt count( iTopCharacterSet->Count() ); + for( TInt i = 0; i < count; i++ ) + { + if( (*iTopCharacterSet)[i].Identifier() == aCharacterSetId ) + { + return ETrue; + } + } + return EFalse; + } + +// End of file diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesteraudioplaylistplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesteraudioplaylistplugin.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,338 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +#include +#include + +#include +#include + +#include "harvesteraudioplaylistplugin.h" +#include "mdeobjectwrapper.h" +#include "mdsutils.h" +#include "harvestercommon.h" + +#include "harvesterlog.h" + +// for CleanupResetAndDestroyPushL +#include + +CHarvesterAudioPlaylistPluginPropertyDefs::CHarvesterAudioPlaylistPluginPropertyDefs() : CBase() + { + } + +void CHarvesterAudioPlaylistPluginPropertyDefs::ConstructL(CMdEObjectDef& aObjectDef) + { + CMdENamespaceDef& nsDef = aObjectDef.NamespaceDef(); + + // Property definitions + CMdEObjectDef& objectDef = nsDef.GetObjectDefL( MdeConstants::Object::KBaseObject ); + iCreationDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KCreationDateProperty ); + iLastModifiedDatePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KLastModifiedDateProperty ); + iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); + iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); + iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + + CMdEObjectDef& albumObjectDef = nsDef.GetObjectDefL( MdeConstants::Album::KAlbumObject ); + iAlbumTypeDef = &albumObjectDef.GetPropertyDefL( MdeConstants::Album::KTypeProperty ); + + CMdEObjectDef& playlistObjectDef = nsDef.GetObjectDefL( MdeConstants::AudioPlaylistItem::KAudioPlaylistItem ); + iAlbumIDDef = &playlistObjectDef.GetPropertyDefL( MdeConstants::AudioPlaylistItem::KPlaylistIDProperty ); + iAudioObjectIDDef = &playlistObjectDef.GetPropertyDefL( MdeConstants::AudioPlaylistItem::KAudioObjectIDProperty ); + iPositionDef = &playlistObjectDef.GetPropertyDefL( MdeConstants::AudioPlaylistItem::KPositionProperty ); + } + +CHarvesterAudioPlaylistPluginPropertyDefs* CHarvesterAudioPlaylistPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef) + { + CHarvesterAudioPlaylistPluginPropertyDefs* self = + new (ELeave) CHarvesterAudioPlaylistPluginPropertyDefs(); + CleanupStack::PushL( self ); + self->ConstructL( aObjectDef ); + CleanupStack::Pop( self ); + return self; + } + +using namespace MdeConstants; + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlugin::CHarvesterAudioPlugin +// --------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistPlugin::CHarvesterAudioPlaylistPlugin() : + CHarvesterPlugin() + { + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::NewL +// --------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistPlugin* CHarvesterAudioPlaylistPlugin::NewL() + { + WRITELOG( "CHarvesterAudioPlaylistPlugin::NewL()" ); + CHarvesterAudioPlaylistPlugin* self = new (ELeave) CHarvesterAudioPlaylistPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::~CHarvesterAudioPlaylistPlugin +// --------------------------------------------------------------------------- +// +CHarvesterAudioPlaylistPlugin::~CHarvesterAudioPlaylistPlugin() + { + WRITELOG( "CHarvesterAudioPlaylistPlugin::~CHarvesterAudioPlaylistPlugin()" ); + + delete iPlaylistParser; + delete iPropDefs; + delete iMime; + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::ConstructL +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::ConstructL() + { + WRITELOG( "CHarvesterAudioPlaylistPlugin::ConstructL()" ); + SetPriority( KHarvesterPriorityHarvestingPlugin - 1 ); + + iPlaylistParser = CHarvesterAudioPlaylistParser::NewL(); + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::HarvestL (from CHarvesterPlugin) +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::HarvestL( CHarvesterData* aHD ) + { + WRITELOG( "CHarvesterAudioPlaylistPlugin::HarvestL()" ); + + TRAPD( err, DoHarvestL( aHD ) ); + + if ( err != KErrNone ) + { + aHD->SetErrorCode( err ); + } + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::DoHarvestL +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::DoHarvestL( CHarvesterData* aHD ) + { + WRITELOG( "CHarvesterAudioPlaylistPlugin::DoHarvestL()" ); + CMdEObject& mdeObject = aHD->MdeObject(); + + TBool isAdd = EFalse; + if ( mdeObject.Placeholder() || mdeObject.Id() == KNoId ) // is a new object or placeholder + { + isAdd = ETrue; + } + else + { + return; // Once playlist has been imported, changes made to it by Music Player + // will not get written back to original playlist file. Thus changes to playlist + // should be done within Music Player, and MDS will prevent playlist that + // have already been imported to be changes so that there will not be + // several versions of same playlist imported by accident. + } + + GetPropertiesL( aHD, isAdd ); + } + + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::GetPropertiesL +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::GetPropertiesL( CHarvesterData* aHD, + TBool aIsAdd ) + { + CMdEObject& mdeObject = aHD->MdeObject(); + + // get creation time, modified time and file size + if( !mdeObject.Placeholder() ) + { + GetPlaceHolderPropertiesL( aHD, aIsAdd ); + } + + const TDesC& uri = mdeObject.Uri(); + + TBool isSupported( GetMimeTypePropertyL( aHD, aIsAdd ) ); + + if( isSupported ) + { + GetMusicPropertiesL( aHD, aIsAdd ); + } + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::GetPlaceHolderPropertiesL +// Get placeholder properties (creation time, modify time and file size). +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::GetPlaceHolderPropertiesL( CHarvesterData* aHD, + TBool aIsAdd ) + { + CMdEObject& mdeObject = aHD->MdeObject(); + + const TDesC& uri = mdeObject.Uri(); + + TEntry entry; + TInt err = iFs.Entry( uri, entry ); + + if ( err!= KErrNone ) + { + User::Leave( err ); // metadata cannot be gathered! + } + + TTime now; + now.HomeTime(); + + if( !iPropDefs ) + { + CMdEObjectDef& objectDef = mdeObject.Def(); + iPropDefs = CHarvesterAudioPlaylistPluginPropertyDefs::NewL( objectDef ); + } + + CMdeObjectWrapper::HandleObjectPropertyL( + mdeObject, *iPropDefs->iCreationDatePropertyDef, &now, aIsAdd ); + + CMdeObjectWrapper::HandleObjectPropertyL( + mdeObject, *iPropDefs->iLastModifiedDatePropertyDef, &entry.iModified, aIsAdd ); + + CMdeObjectWrapper::HandleObjectPropertyL( + mdeObject, *iPropDefs->iSizePropertyDef, &entry.iSize, aIsAdd ); + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::GetMimeTypePropertyL +// Get mime type. +// --------------------------------------------------------------------------- +// +TBool CHarvesterAudioPlaylistPlugin::GetMimeTypePropertyL( + CHarvesterData* aHD, TBool aIsAdd ) + { + CMdEObject& mdeObject = aHD->MdeObject(); + + TBuf<40> mimeType( KNullDesC ); + TBool supported( EFalse ); + supported = iPlaylistParser->ParseMimeType( mdeObject.Uri(), mimeType ); + delete iMime; + iMime = NULL; + iMime = mimeType.AllocL(); + + if( !iPropDefs ) + { + CMdEObjectDef& objectDef = mdeObject.Def(); + iPropDefs = CHarvesterAudioPlaylistPluginPropertyDefs::NewL( objectDef ); + } + + CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, + *iPropDefs->iItemTypePropertyDef, (TAny*)&(mimeType), + aIsAdd ); + + return supported; + } + +// --------------------------------------------------------------------------- +// CHarvesterAudioPlaylistPlugin::GetMusicPropertiesL +// --------------------------------------------------------------------------- +// +void CHarvesterAudioPlaylistPlugin::GetMusicPropertiesL( CHarvesterData* aHD, + TBool aIsAdd ) + { + CMdEObject& mdeObject = aHD->MdeObject(); + + if( !iPropDefs ) + { + CMdEObjectDef& objectDef = mdeObject.Def(); + iPropDefs = CHarvesterAudioPlaylistPluginPropertyDefs::NewL( objectDef ); + } + + CMdESession& session = mdeObject.Session(); + +#ifdef MDS_PLAYLIST_HARVESTING_ENABLED + TInt playlistType( MdeConstants::Album::EAlbumMusicPlaylist ); + CMdeObjectWrapper::HandleObjectPropertyL( + mdeObject, *iPropDefs->iAlbumTypeDef, &playlistType, aIsAdd ); +#endif + + RPointerArray playlistItems; + TCleanupItem cleanupItem( MdsUtils::CleanupPtrArray, &playlistItems ); + CleanupStack::PushL( cleanupItem ); + + const TBool parsed( iPlaylistParser->ParseL( mdeObject.Uri(), playlistItems, iMime->Des() ) ); + + if( parsed ) + { + TTime curtime( 0 ); + curtime.UniversalTime(); + + const TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset(); + const TTime localTime = curtime + timeOffsetSeconds; + + RPointerArray objectArray; + + CMdENamespaceDef& nsDef = session.GetDefaultNamespaceDefL(); + CMdEObjectDef& playlistObjectDef = nsDef.GetObjectDefL( MdeConstants::AudioPlaylistItem::KAudioPlaylistItem ); + + const TInt count( playlistItems.Count() ); + for( TInt i = 0; i < count; i++) + { + CMdEObject* mdeAudioObject = session.GetObjectL( playlistItems[i]->Des() ); + if( mdeAudioObject ) + { + CMdEObject* object = session.NewObjectLC( playlistObjectDef, Object::KAutomaticUri ); + + object->AddTimePropertyL( *iPropDefs->iCreationDatePropertyDef, localTime ); + object->AddTimePropertyL( *iPropDefs->iLastModifiedDatePropertyDef, curtime ); + object->AddUint32PropertyL( *iPropDefs->iSizePropertyDef, 0 ); + object->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, AudioPlaylistItem::KAudioPlaylistItemType ); + + object->AddInt32PropertyL( *iPropDefs->iAlbumIDDef, mdeObject.Id() ); + object->AddInt32PropertyL( *iPropDefs->iAudioObjectIDDef, mdeAudioObject->Id() ); + + // position is considered to represent items relative position in the list + // if item is removed from the middle of the list, position is still valid even though + // the actual position value is not updated + object->AddInt32PropertyL( *iPropDefs->iPositionDef, (i+1) ); // playlist position starts from 1 + objectArray.AppendL( object ); + CleanupStack::Pop(); // object + } + delete mdeAudioObject; + } + CleanupResetAndDestroyPushL( objectArray ); + TRAPD( addError, session.AddObjectsL( objectArray ) ); + if ( addError != KErrNone ) + { + WRITELOG1( "CHarvesterAudioPlaylistPlugin::GetMusicPropertiesL - Add items to MDE error: %d", addError ); + } + CleanupStack::PopAndDestroy( &objectArray ); + } + + CleanupStack::PopAndDestroy( &playlistItems ); + } + +// End of file + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesterm3uplaylistparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/src/harvesterm3uplaylistparser.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,534 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "harvesterm3uplaylistparser.h" + +#include "mdsutils.h" +#include "harvesterlog.h" + +_LIT( KMDSM3ULineChange, "\n" ); +_LIT( KMDSM3UTagExtm3u, "#EXTM3U" ); +_LIT (KMDSM3UTagExtinf, "#EXTINF:" ); +_LIT( KMDSM3UPoint, ","); +_LIT( KMDSM3UTagExt, "#"); +_LIT( KMDSM3UAbsPath, ":\\"); + +const TInt KMDSM3UCarriageReturn = 13; +const TInt KMDSM3UNoOffset = 0; +const TInt KPlaylistSampleLength = 10000; +const TUint KUnicodeBOM = 0xFEFF; +const TInt KPlaylistMaxSampleLength = 130000; +const TInt KMinimumConfidenceRequired = 75; +const TInt KMDSM3UPlaylistMaxItemCount = KMaxTInt; +const TInt KPathStartingChars = 3; + +// MODULE DATA STRUCTURES +enum TMDSM3UPlaylistLineType + { + EMDSM3UPlaylistLineTypeExtinf = 1, + EMDSM3UPlaylistLineTypePath = 2, + EMDSM3UPlaylistLineTypeNotSupported = 3, + EMDSM3UPlaylistLineTypeCorrupted = 4 + }; + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::NewL +// ----------------------------------------------------------------------------- +// +CHarvesterM3UPlaylistParser* CHarvesterM3UPlaylistParser::NewL( RFs& aFs, + CArrayFix* aAvailableCharacterSet, + CArrayFix* aTopCharacterSet ) + { + CHarvesterM3UPlaylistParser* self = new ( ELeave ) CHarvesterM3UPlaylistParser( + aFs, aAvailableCharacterSet, aTopCharacterSet ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CHarvesterM3UPlaylistParser::~CHarvesterM3UPlaylistParser() + { + Reset(); + } + + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::CHarvesterM3UPlaylistParser +// ----------------------------------------------------------------------------- +// +CHarvesterM3UPlaylistParser::CHarvesterM3UPlaylistParser( RFs& aFs, + CArrayFix* aAvailableCharacterSet, + CArrayFix* aTopCharacterSet ) + :iFs( aFs ), iAvailableCharacterSet( aAvailableCharacterSet ), + iTopCharacterSet( aTopCharacterSet ), iEndLineNumber( KMDSM3UPlaylistMaxItemCount ) + { + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ParseL +// ----------------------------------------------------------------------------- +// +TBool CHarvesterM3UPlaylistParser::ParseL( const TDesC& aFileName, + RPointerArray& aUriArray ) + { + iPlaylistFilePath.Set( aFileName ); + ReadPlaylistFileToBufferL(); + ParsePlaylistBufferL( aUriArray, iInvalidItems ); + + // If at the moment, we know that there is at least one error parsing + // with auto detect encoding, we don't need to proceed until end of + // file anymore, this playlist file is concluded to be corrupted + if ( iInvalidItems > 0 ) + { + aUriArray.Reset(); + Reset(); + User::Leave( KErrCorrupt ); + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ResetL +// ----------------------------------------------------------------------------- +// +void CHarvesterM3UPlaylistParser::Reset() + { + delete iBuffer; + iBuffer = NULL; + delete iLine; + iLine = NULL; + iBufferPtr.Set( KNullDesC ); + iCurrentLineNumber = 0; + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ReadPlaylistFileToBufferL +// ----------------------------------------------------------------------------- +// +void CHarvesterM3UPlaylistParser::ReadPlaylistFileToBufferL() + { +#ifdef _DEBUG + WRITELOG1( "Before reading playlist to buffer: heap size = %d", User::Heap().Size() ); +#endif + + TEntry entry; + User::LeaveIfError( iFs.Entry( iPlaylistFilePath, entry ) ); + + HBufC* buffer = HBufC::NewLC( entry.iSize ); + TPtr ptr = buffer->Des(); + + HBufC8* buf8 = HBufC8::NewLC( entry.iSize ); + TPtr8 ptr8 = buf8->Des(); + + // Read the first KPlaylistSampleLength bytes of the file + TInt sampleLength( KPlaylistSampleLength ); + if( sampleLength > entry.iSize ) + { + sampleLength = entry.iSize; + } + User::LeaveIfError( iFs.ReadFileSection( + iPlaylistFilePath, 0, ptr8, sampleLength ) ); + + // auto detect character encoding + TUint charSetId( 0 ); + TInt error = DetectCharacterSetL( *buf8, *iTopCharacterSet, charSetId ); + WRITELOG2("Encoding detected using top character set is 0x%x, error %d", charSetId, error); + + // when we fail to detect the encoding, use all available character set in the + // system to try again. If that also fails, abandon the operation. + if ( error ) + { + User::LeaveIfError( DetectCharacterSetL( *buf8, *iAvailableCharacterSet, charSetId ) ); + WRITELOG1( "Encoding detected using available character set is 0x%x", charSetId ); + } + + // read the whole file if the sample taken isn't the whole file + if ( sampleLength != entry.iSize ) + { + User::LeaveIfError( iFs.ReadFileSection( + iPlaylistFilePath, 0, ptr8, entry.iSize) ); + } + + // perform character conversion using the selected encoding + TInt state( CCnvCharacterSetConverter::KStateDefault ); + TInt numOfUnconvertibleChars( 0 ); + CCnvCharacterSetConverter* charSetConv = CCnvCharacterSetConverter::NewLC(); + charSetConv->PrepareToConvertToOrFromL( charSetId, *iAvailableCharacterSet, iFs ); + TInt retVal = charSetConv->ConvertToUnicode( ptr, *buf8, state, numOfUnconvertibleChars ); + User::LeaveIfError( retVal ); + + // try again if the character set wasn't detected using the whole file + if( (retVal > 0 || numOfUnconvertibleChars > 0) && (sampleLength != entry.iSize) ) + { + WRITELOG3( "retVal = %d, numOfUnconvertibleChars = %d, entry.iSize = %d", + retVal, numOfUnconvertibleChars, entry.iSize ); + numOfUnconvertibleChars = 0; + retVal = 0; + User::LeaveIfError( DetectCharacterSetL( *buf8, *iAvailableCharacterSet, charSetId ) ); + charSetConv->PrepareToConvertToOrFromL( charSetId, *iAvailableCharacterSet, iFs ); + retVal = charSetConv->ConvertToUnicode( ptr, *buf8, state, numOfUnconvertibleChars ); + } + + if ( retVal > 0 || numOfUnconvertibleChars > 0 ) + { + WRITELOG2( "Unable to find character encoding for the playlist file. retVal = %d, numOfUnconvertibleChars = %d", + retVal, numOfUnconvertibleChars ); + User::Leave( KErrNotSupported ); + } + + // remove the byte order mark (BOM) character prepended at the beginning + // of the stream if encoded with unicode as per Unicode section 2.4 + if ( (charSetId == KCharacterSetIdentifierUnicodeLittle || + charSetId == KCharacterSetIdentifierUnicodeBig) && + ptr.Length() > 0 && + ptr[0] == KUnicodeBOM ) + { + ptr.Delete( 0,1 ); + } + + iBuffer = buffer; + iBufferPtr.Set( *iBuffer ); + + CleanupStack::PopAndDestroy (2, buf8 ); // charSetConv & buf8 + CleanupStack::Pop( buffer ); + + // brand new buffer which hasn't been read, reset iCurrentLineNumber and + // iEndLineNumber + iCurrentLineNumber = 0; + +#ifdef _DEBUG + WRITELOG1( "After reading playlist to buffer: heap size = %d", User::Heap().Size() ); +#endif + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::DetectCharacterSetL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterM3UPlaylistParser::DetectCharacterSetL( + const TDesC8& aSample, + const CArrayFix& aCharacterSet, + TUint& aCharSetId) + { + // CCnvCharacterSetConverter::ConvertibleToCharSetL hangs if sample is too big + if ( aSample.Size() > KPlaylistMaxSampleLength ) + { + User::Leave( KErrNotSupported ); + } + + TInt confidence( 0 ); + TInt highestConfidence( 0 ); + TUint charSetId( 0 ); + TUint highestConfidencecharSetId( 0 ); + + CCnvCharacterSetConverter* charSetConv = CCnvCharacterSetConverter::NewLC(); + TInt count = aCharacterSet.Count(); + for ( TInt i=0; i < count; i++ ) + { + charSetId = aCharacterSet.At(i).Identifier(); + charSetConv->ConvertibleToCharSetL( confidence, charSetId, aCharacterSet, aSample ); + if ( confidence > highestConfidence ) + { + highestConfidence = confidence; + highestConfidencecharSetId = charSetId; + } + } + CleanupStack::PopAndDestroy( charSetConv ); + WRITELOG2( "CMPXM3uPlaylistImporter::DetectCharacterSetL :-> Confidence[%d] CharSetId[0x%x]", + confidence, aCharSetId ); + if ( highestConfidence == 0 || highestConfidence < KMinimumConfidenceRequired ) + { + return KErrNotFound; + } + else + { + aCharSetId = highestConfidencecharSetId; + return KErrNone; + } + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ParsePlaylistBufferL +// ----------------------------------------------------------------------------- +// +void CHarvesterM3UPlaylistParser::ParsePlaylistBufferL( + RPointerArray& aPlaylist, + TInt& aInvalidItemCount) + { + // Read and process all the lines in the file + // + // the order of the following conditions is important. ReadNextLineL + // should be called last to avoid skipping one line + while ( iCurrentLineNumber < iEndLineNumber && + aPlaylist.Count() < KMDSM3UPlaylistMaxItemCount && + ReadNextLineL() ) + { + ProcessLineL( aPlaylist, aInvalidItemCount ); + } + + if ( aPlaylist.Count() == KMDSM3UPlaylistMaxItemCount ) + { + Reset(); + User::Leave( KErrOverflow ); + } + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ReadNextLineL +// ----------------------------------------------------------------------------- +// +TBool CHarvesterM3UPlaylistParser::ReadNextLineL() + { + // iBuffer should exist when this function is called + __ASSERT_DEBUG( iBuffer, User::Leave( KErrBadDescriptor ) ); + + if ( !iBufferPtr.Length() ) + { + return EFalse; + } + + delete iLine; + iLine = NULL; + + // Try to find line change + TInt offset = iBufferPtr.FindF( KMDSM3ULineChange ); + + if( offset == KErrNotFound ) + { + // No line change was found --> last line had no line change + iLine = iBufferPtr.AllocL(); + // Set iBufferPtr to the end of buffer + iBufferPtr.Set( iBufferPtr.Right(0) ); + } + else + { + // Found line change + TInt length( offset ); + if ( (offset > KMDSM3UNoOffset) && + (iBufferPtr[length - 1] == KMDSM3UCarriageReturn) ) + { + --length; + } + + iLine = iBufferPtr.Left(length).AllocL(); + + // Move past the line feed + iBufferPtr.Set( iBufferPtr.Mid(++offset) ); + } + + // Remove leading and trailing space characters from iLine's data. + TPtr ptr = iLine->Des(); + ptr.Trim(); + + iCurrentLineNumber++; + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ProcessLineL +// ----------------------------------------------------------------------------- +// +void CHarvesterM3UPlaylistParser::ProcessLineL( + RPointerArray& aPlaylist, + TInt& aInvalidItemCount) + { + if ( iCurrentLineNumber == 1 ) // first line + { + // Check whether the file is in the extented format + TInt offset = iLine->Find( KMDSM3UTagExtm3u ); + if( offset == KErrNotFound || offset != KMDSM3UNoOffset || + iLine->Length() != KMDSM3UTagExtm3u().Length() ) + { + // The file is not in the extented format + iExtendedFormat = EFalse; + } + else + { + // The file is in the extented format + iExtendedFormat = ETrue; + return; + } + } + + // Parse line and then decide what to do with it + switch( ParseLineL( iItem, aInvalidItemCount ) ) + { + case EMDSM3UPlaylistLineTypeExtinf: + // Continue to next round + break; + + case EMDSM3UPlaylistLineTypePath: + { + // Line was a path => add item to playlist + aPlaylist.AppendL( iItem.AllocL() ); + } + break; + + case EMDSM3UPlaylistLineTypeNotSupported: + case EMDSM3UPlaylistLineTypeCorrupted: + default: + { + iItem = KNullDesC; + } + break; + } + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ParseLineL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterM3UPlaylistParser::ParseLineL( + TFileName& aItem, + TInt& aInvalidItemCount) + { + __ASSERT_DEBUG( iLine, User::Leave(KErrAbort) ); + + if( !iLine->Length() ) + { + // Empty line => line is invalid + return EMDSM3UPlaylistLineTypeNotSupported; + } + + if( iExtendedFormat ) + { + // File is in the extented format => check whether there is extented + // info in this line. + TInt offset = iLine->Find( KMDSM3UTagExtinf ); + if( offset != KErrNotFound && offset == KMDSM3UNoOffset ) + { + offset = iLine->Find( KMDSM3UPoint ); + + if( offset != KErrNotFound ) + { + return EMDSM3UPlaylistLineTypeExtinf; // line type extinf + } + } + } + + // File is not in the extented format or supported info not found from this + // line. + switch( iLine->Find(KMDSM3UTagExt) ) + { + case KMDSM3UNoOffset: + // Unsupported extended info tag found from this line + return EMDSM3UPlaylistLineTypeNotSupported; + + case KErrNotFound: + default: + // Extended info not found from the beginning of line => line is + // a path. + { + // Get absolute path + TInt error( KErrNone ); + HBufC* uri = ParseAbsolutePathLC( *iLine, error ); + + if( error ) + { + CleanupStack::PopAndDestroy( uri ); + ++aInvalidItemCount; + return EMDSM3UPlaylistLineTypeCorrupted; + } + + aItem = uri->Des(); + + CleanupStack::PopAndDestroy( uri ); + + return EMDSM3UPlaylistLineTypePath; // line type path + } + } + } + +// ----------------------------------------------------------------------------- +// CHarvesterM3UPlaylistParser::ParseAbsolutePathLC +// ----------------------------------------------------------------------------- +// +HBufC* CHarvesterM3UPlaylistParser::ParseAbsolutePathLC( + const TDesC& aPath, + TInt& aError) + { + HBufC* path = NULL; + + TBool isAbsolute( EFalse ); + + if( aPath.Length() > KPathStartingChars && + !aPath.Mid(1, 2).CompareF( KMDSM3UAbsPath ) ) // magic: the 2nd and 3rd chars + // are always ":\" + // for absolute paths + { + isAbsolute = ETrue; + } + + if( aPath.Length() > KMaxFileName ) // Test if path is too long + { + aError = KErrCorrupt; + } + else if( isAbsolute ) + { + aError = KErrNone; + aError = iFs.IsValidName( aPath ) ? KErrNone : KErrBadName; + path = aPath.AllocLC(); + } + else + { + // Given path could be relative => create absolute path and test it + // Playlist file path + TParse playlistPath; + playlistPath.Set( iPlaylistFilePath, NULL, NULL ); + // Path to the folder, where playlist file is located to + TPtrC currentFolder = playlistPath.DriveAndPath(); + // Create absolute path + path = HBufC::NewLC( currentFolder.Length() + aPath.Length() ); + + TPtr tmpPtr( path->Des() ); + tmpPtr = currentFolder; + tmpPtr += aPath; + + aError = iFs.IsValidName(*path) ? KErrNone : KErrBadName; + } + + // It is possible that a song exists in the filesystem but isn't added to + // the database because it's not a supported type. If such song is included + // in a playlist, it will be added to the database when the playlist is added. + // Because of this, we cannot rely on whether the song exists in the database + // to conclude whether the song is a broken link. We need to check for file + // existence here. For the unsupported songs included in the playlist, they + // will then be marked as corrupted when user initiates playback of those + // songs. + if ( !aError && + !BaflUtils::FileExists(iFs, *path) ) + { + aError = KErrPathNotFound; + } + + return path; + } + +// End of file diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/AudioPlaylistPlugin/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/harvesterplugins/AudioPlaylistPlugin/src/proxy.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 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: +* +*/ + + + +#include +#include +#include "harvesteraudioplaylistplugin.h" + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy KImplementationTable[] = + { + {{0x200211F6}, (TProxyNewLPtr)CHarvesterAudioPlaylistPlugin::NewL} + }; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + return KImplementationTable; + } + diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp --- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -193,7 +193,7 @@ void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHarvesterData ) { - WRITELOG( "CHarvesterImagePlugin::HarvestL()" ); + WRITELOG( "CHarvesterOMADRMPlugin::HarvestL()" ); CMdEObject& mdeObject = aHarvesterData->MdeObject(); CDRMHarvestData* drmHarvestData = CDRMHarvestData::NewL(); CleanupStack::PushL( drmHarvestData ); @@ -330,31 +330,36 @@ WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err ); } - CImageDecoder* decoder = NULL; - - TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, - ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode ))); - - CleanupStack::PushL( decoder ); - - if(decoder && !err) + if( aMetadataObject.Def().Name() == MdeConstants::Image::KImageObject ) { - WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." ); - // Get image width, frame count, height and bits per pixel from image decoder. - const TFrameInfo info = decoder->FrameInfo( 0 ); - const TSize imageSize = info.iOverallSizeInPixels; - const TInt framecount = decoder->FrameCount(); - aFileData.iFrameCount = framecount; - aFileData.iImageWidth = imageSize.iWidth; - aFileData.iImageHeight = imageSize.iHeight; - aFileData.iBitsPerPixel = info.iBitsPerPixel; - } - else - { - WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err ); + CImageDecoder* decoder = NULL; + + TRAP( err, decoder = CImageDecoder::FileNewL( iFs, uri, ContentAccess::EPeek, + ( CImageDecoder::TOptions )( CImageDecoder::EPreferFastDecode ))); + + CleanupStack::PushL( decoder ); + + if(decoder && !err) + { + WRITELOG( "CHarvesterImagePlugin::GatherData() - Image decoder has opened the file." ); + // Get image width, frame count, height and bits per pixel from image decoder. + const TFrameInfo info = decoder->FrameInfo( 0 ); + const TSize imageSize = info.iOverallSizeInPixels; + const TInt framecount = decoder->FrameCount(); + aFileData.iFrameCount = framecount; + aFileData.iImageWidth = imageSize.iWidth; + aFileData.iImageHeight = imageSize.iHeight; + aFileData.iBitsPerPixel = info.iBitsPerPixel; + } + else + { + WRITELOG1( "CHarvesterImagePlugin::GatherData() - ERROR: decoder %d", err ); + } + CleanupStack::PopAndDestroy( decoder ); } - CleanupStack::PopAndDestroy( 4 ); // content, data, attrSet, imagedecoder + + CleanupStack::PopAndDestroy( 3 ); // content, data, attrSet return KErrNone; } diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp --- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -339,7 +339,7 @@ if ( error != KErrNone ) { WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - File open error: %d", error ); - if( error == KErrInUse ) + if( error == KErrInUse || KErrLocked ) { #ifdef _DEBUG TPtrC fileName( aUri.Mid(2) ); @@ -627,6 +627,7 @@ TRAP( error, helixMetadata->OpenFileL( file ) ); // No need for the file handle anymore so closing it + WRITELOG( "CHarvesterVideoPlugin - Parsing done, file handle can be closed" ); file.Close(); if ( error == KErrNone ) @@ -981,7 +982,7 @@ } #endif } - WRITELOG( "CHarvesterVideoPlugin - Closing file" ); + WRITELOG( "CHarvesterVideoPlugin - Closing file, if still open" ); CleanupStack::PopAndDestroy( &file ); #ifdef _DEBUG @@ -1247,6 +1248,7 @@ CleanupStack::PushL( helixMetadata ); TRAPD( err, helixMetadata->OpenFileL( aFile ) ); + aFile.Close(); if( err == KErrNone ) { @@ -1273,10 +1275,10 @@ const TInt mimeCount = mimes.Count(); - // at least one MIME type must be found + // Set to Video, regardless how badly file is corrupted if( mimeCount == 0 ) { - User::Leave( KErrNotFound ); + aType.Copy( KVideo ); } for( TInt i = 0; i < mimeCount; i++ ) @@ -1336,8 +1338,7 @@ if( blackListError == KErrNone ) { RemoveFileFromBlackList( tempName, mediaId ); - } - + } } TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId ) diff -r b73252188534 -r f23c07ec56e2 harvester/harvesterplugins/group/bld.inf --- a/harvester/harvesterplugins/group/bld.inf Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/harvesterplugins/group/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -24,6 +24,10 @@ #include "../RTPPlugin/group/bld.inf" #include "../AudioPlugin/group/bld.inf" +#ifdef MDS_PLAYLIST_HARVESTING_ENABLED +#include "../AudioPlaylistPlugin/group/bld.inf" +#endif + PRJ_PLATFORMS DEFAULT diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp --- a/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/fileplugin/src/processoriginmapper.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -227,7 +227,7 @@ // TInt CProcessOriginMapper::ReadFileL() { - WRITELOG( "CProcessOriginMapper::ReadFileL - reading default file..." ); + WRITELOG( "CProcessOriginMapper::ReadFileL - reading default file" ); iDefaultFileRead = ETrue; const TInt count = ReadFileL( KDefaultMappingFile ); iDefaultFileRead = EFalse; diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h --- a/harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/inc/mmcmounttaskao.h Tue Aug 31 15:37:30 2010 +0300 @@ -53,9 +53,9 @@ void SetHarvesterPluginFactory( CHarvesterPluginFactory* aPluginFactory ); /** - * Returns internal hard drive's media id if the device has one. 0 if not or drive is not present + * Returns internal hard drive's media id if the device has one. */ - TUint32 GetInternalDriveMediaId(); + TUint32 GetInternalDriveMediaId( TBool& aPresent ); void SetCachingStatus( TBool aCachingStatus ); diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -104,7 +104,7 @@ TUint32 mediaId( 0 ); iMediaIdUtil->GetMediaId( aDrivePath, mediaId ); - WRITELOG1( "CMmcFileList::BuildFileListL - mediaId: %d", mediaId ); + WRITELOG1( "CMmcFileList::BuildFileListL - mediaId: %u", mediaId ); CDir* directory = NULL; TFileName name; @@ -294,7 +294,6 @@ aEntryArray.Compress(); } - WRITELOG( "CMmcFileList::HandleFileEntryL -- cleanupstack" ); CleanupStack::PopAndDestroy( &results ); CleanupStack::PopAndDestroy( &fileInfos ); CleanupStack::PopAndDestroy( &uris ); diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcmonitorao.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -124,6 +124,8 @@ return; } + StartNotify(); + iPreviousDriveList.Zero(); iPreviousDriveList.Copy( iDriveList ); @@ -138,8 +140,6 @@ #ifdef _DEBUG PrintAllLists(); #endif - - StartNotify(); } #ifdef _DEBUG @@ -161,7 +161,7 @@ iFs.NotifyChangeCancel( iStatus ); } -CMMCMonitorAO::CMMCMonitorAO() : CActive( KHarvesterPriorityMonitorPlugin ), +CMMCMonitorAO::CMMCMonitorAO() : CActive( KHarvesterServerHighPriority ), iObserver( NULL ) { } @@ -283,7 +283,7 @@ { if ( iMediaIdList[i] != mediaId ) { - WRITELOG3( "CMMCMonitorAO::CompareDriveLists media changed %d, old=%d, new=%d", i, iMediaIdList[i], mediaId ); // DEBUG INFO + WRITELOG3( "CMMCMonitorAO::CompareDriveLists media changed %d, old=%u, new=%u", i, iMediaIdList[i], mediaId ); // DEBUG INFO // skip mount events if mediaId is 0 if ( iMediaIdList[i] != 0 ) { diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -116,7 +116,8 @@ TBool presentState( EFalse ); TUint32 hdMediaId( 0 ); - hdMediaId = iMountTask->GetInternalDriveMediaId(); + TBool hdPresent( EFalse ); + hdMediaId = iMountTask->GetInternalDriveMediaId( hdPresent ); for( TInt i = medias.Count() - 1; i >=0; i-- ) { @@ -137,10 +138,10 @@ } } - if( hdMediaId == 0 ) + if( hdMediaId == 0 || !hdPresent ) { // Try to fetch internall mass storage media id again if it was not mounted - hdMediaId = iMountTask->GetInternalDriveMediaId(); + hdMediaId = iMountTask->GetInternalDriveMediaId( hdPresent ); } // scan mass storage to catch all chances even if battery dies during operation that should be catched @@ -149,7 +150,7 @@ TBool exists( EFalse ); TRAP_IGNORE( exists= iMdEClient->GetMediaL( hdMediaId, driveLetter, presentState ) ); - if ( exists ) + if ( exists && hdPresent ) { WRITELOG("CMMCMonitorPlugin::StartMonitoring - start mass storage scan"); @@ -267,33 +268,39 @@ if( internalMassStorageError == KErrNone ) { const TUint32 massStorageMediaId( internalMassStorageVolumeInfo.iUniqueID ); - TUint32 mmcMediaId( 0 ); - TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ) ); - if( mmcError == KErrNone ) + if( massStorageMediaId == aMediaID && + massStorageMediaId != 0 ) { - TVolumeInfo mmcVolumeInfo; - mmcError = iFs.Volume( mmcVolumeInfo, drive ); + TUint32 mmcMediaId( 0 ); + TInt mmcDrive( -1 ); + TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) ); if( mmcError == KErrNone ) { - mmcMediaId = mmcVolumeInfo.iUniqueID; + if( drive != mmcDrive ) + { + TVolumeInfo mmcVolumeInfo; + mmcError = iFs.Volume( mmcVolumeInfo, mmcDrive ); + if( mmcError == KErrNone ) + { + mmcMediaId = mmcVolumeInfo.iUniqueID; + } + } + else + { + mmcMediaId = massStorageMediaId; + } } - } - // If removable storage is not found, assume internal mass storage was mounted - if( mmcError ) - { - if( massStorageMediaId != 0 && - massStorageMediaId == aMediaID ) + // If removable storage is not found, assume internal mass storage was mounted + if( mmcError ) + { + iMdEClient->CheckMassStorageMediaId( massStorageMediaId ); + } + else if( massStorageMediaId != mmcMediaId ) { iMdEClient->CheckMassStorageMediaId( massStorageMediaId ); - } - } - else if( massStorageMediaId != mmcMediaId && - massStorageMediaId != 0 && - massStorageMediaId == aMediaID ) - { - iMdEClient->CheckMassStorageMediaId( massStorageMediaId ); - } + } + } } } diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcmounttaskao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -114,6 +114,25 @@ { WRITELOG("CMMCMountTaskAO::StartMount"); + // Remove pending mount request for the same drive + // if for example USB cable is pluged and unpluged + // several times in a row + for( TInt i = iMountDataQueue.Count() - 1; i >=0; i-- ) + { + WRITELOG( "CMMCMountTaskAO::StartUnmountL - checking for pending mount notifications" ); + TMountData* tempData = iMountDataQueue[i]; + if( tempData->iMediaID == aMountData.iMediaID && + tempData->iMountType == TMountData::EMount && + aMountData.iMountType == TMountData::EMount && + tempData->iDrivePath == aMountData.iDrivePath ) + { + WRITELOG( "CMMCMountTaskAO::StartUnmountL - removing obsolite mount notifications" ); + iMountDataQueue.Remove(i); + delete tempData; + tempData = NULL; + } + } + User::LeaveIfError( iMountDataQueue.Append( &aMountData )); if ( iNextRequest == ERequestIdle ) @@ -135,7 +154,26 @@ Deinitialize(); } } - + + // Remove pending unmount request for the same drive + // if for example USB cable is pluged and unpluged + // several times in a row + for( TInt i = iMountDataQueue.Count() - 1; i >=0; i-- ) + { + WRITELOG( "CMMCMountTaskAO::StartUnmountL - checking for pending unmount notifications" ); + TMountData* tempData = iMountDataQueue[i]; + if( tempData->iMediaID == aMountData.iMediaID && + tempData->iMountType == TMountData::EUnmount && + aMountData.iMountType == TMountData::EUnmount && + tempData->iDrivePath == aMountData.iDrivePath ) + { + WRITELOG( "CMMCMountTaskAO::StartUnmountL - removing obsolite unmount notifications" ); + iMountDataQueue.Remove(i); + delete tempData; + tempData = NULL; + } + } + User::LeaveIfError( iMountDataQueue.Append( &aMountData )); SetNextRequest( ERequestStartTask ); @@ -181,7 +219,7 @@ WRITELOG1( "iMountData.iMountType: %d", iMountData->iMountType ); WRITELOG1( "iMountData.iDrivePath: %S", &iMountData->iDrivePath ); - WRITELOG1( "iMountData.iMediaID: %d", iMountData->iMediaID ); + WRITELOG1( "iMountData.iMediaID: %u", iMountData->iMediaID ); if ( iMountData->iMountType == TMountData::EMount ) { @@ -393,6 +431,7 @@ { WRITELOG1( "CMMCMountTaskAO::RunError with error code: %d", aError ); Deinitialize(); + SetNextRequest( ERequestStartTask ); return KErrNone; } @@ -415,7 +454,7 @@ void CMMCMountTaskAO::SetNotPresentToMDE() { - WRITELOG1("CMMCMountTaskAO::SetNotPresentToMDE - MediaID %d", iMountData->iMediaID); + WRITELOG1("CMMCMountTaskAO::SetNotPresentToMDE - MediaID %u", iMountData->iMediaID); if ( iMountData->iMediaID ) { iMdeSession->SetFilesToNotPresent( iMountData->iMediaID ); @@ -538,7 +577,7 @@ } } -TUint32 CMMCMountTaskAO::GetInternalDriveMediaId() +TUint32 CMMCMountTaskAO::GetInternalDriveMediaId( TBool& aPresent ) { WRITELOG( "CMMCMountTaskAO::GetInternalDriveMediaId" ); @@ -581,10 +620,15 @@ // check if disk is internal TUint driveStatus; const TInt err = DriveInfo::GetDriveStatus( iFs, i, driveStatus ); - if ( (err == KErrNone ) && ( driveStatus & DriveInfo::EDriveInternal ) ) + if ( ( err == KErrNone ) && + ( driveStatus & DriveInfo::EDriveInternal )) { // get media id hdMediaId = FSUtil::MediaID( iFs, i ); + if( driveStatus & DriveInfo::EDrivePresent ) + { + aPresent = ETrue; + } break; } } diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcscannerao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -108,6 +108,14 @@ { case( EUninitialized ): { + WRITELOG("CMmcScannerAO::RunL - Starting processing"); + if( iMediaId == 0 ) + { + WRITELOG("CMmcScannerAO::RunL - MediaId == 0 -> end"); + SetState( EDone ); + break; + } + WRITELOG("CMmcScannerAO::RunL - Setting files to not present"); iMdEClient->SetFilesToNotPresent( iMediaId, ETrue ); SetState( EReadFiles ); diff -r b73252188534 -r f23c07ec56e2 harvester/monitorplugins/mmcplugin/src/mmcusbao.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcusbao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/monitorplugins/mmcplugin/src/mmcusbao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -136,7 +136,7 @@ TFileName* fn = new (ELeave) TFileName( driveChar ); _LIT( KIndicator, ":" ); fn->Append( KIndicator ); - WRITELOG1( "CMMCUsbAO::RunL - drive letter: %S", fn ); + WRITELOG1( "CMMCUsbAO::RunL - drive letter: %S", &(*fn) ); PrintDriveStatus( driveStatus ); delete fn; fn = NULL; diff -r b73252188534 -r f23c07ec56e2 harvester/server/inc/harvesterao.h --- a/harvester/server/inc/harvesterao.h Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/inc/harvesterao.h Tue Aug 31 15:37:30 2010 +0300 @@ -22,6 +22,8 @@ #include #include +#include + #include "contextengine.h" #include "mdeharvestersession.h" @@ -584,7 +586,11 @@ HBufC* iMmcSoundsPath; TBool iUnmountDetected; + TBool iUnmountHandlingOngoing; TBool iPriorityInterruptDetected; + + RLocationObjectManipulator iLocManipulator; + TBool iLocManipulatorConnected; }; #endif //__CHARVESTERAO_H__ diff -r b73252188534 -r f23c07ec56e2 harvester/server/src/harvesterao.cpp --- a/harvester/server/src/harvesterao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/src/harvesterao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -62,7 +61,7 @@ _LIT(KVideo, "Video"); _LIT(KInUse, "InUse"); -_LIT(KUndefinedMime, " "); +_LIT(KUndefined, " "); _LIT( KExtensionMp4, "mp4" ); _LIT( KExtensionMpg4, "mpg4" ); @@ -156,7 +155,9 @@ iHarvestingPlaceholders = EFalse; iUnmountDetected = EFalse; + iUnmountHandlingOngoing = EFalse; iPriorityInterruptDetected = EFalse; + iLocManipulatorConnected = EFalse; } // --------------------------------------------------------------------------- @@ -172,6 +173,8 @@ iFs.Close(); + iLocManipulator.Close(); + if (iCtxEngine) { iCtxEngine->ReleaseInstance(); @@ -507,6 +510,7 @@ OstTrace1( TRACE_NORMAL, CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount;aMediaId=%d", aMediaId ); iUnmountDetected = ETrue; + iUnmountHandlingOngoing = ETrue; if( !iServerPaused ) { @@ -731,12 +735,10 @@ iMediaIdUtil->RemoveMediaId( aMediaId ); // resume harvesting from last state - if( !iRamFull && !iDiskFull ) - { - // resume monitoring - ResumeMonitoring(); - TRAP_IGNORE( ResumeHarvesterL() ); - } + iUnmountHandlingOngoing = EFalse; + // resume monitoring + ResumeMonitoring(); + TRAP_IGNORE( ResumeHarvesterL() ); } // --------------------------------------------------------------------------- @@ -847,9 +849,9 @@ { SetPriority( KHarvesterCustomImportantPriority ); } - while( hd != NULL && - iPHArray.Count() < KPlaceholderQueueSize && - hd->ObjectType() == EPlaceholder ) + while( hd && + iPHArray.Count() < KPlaceholderQueueSize && + hd->ObjectType() == EPlaceholder ) { if(iPHArray.Append( hd ) != KErrNone) { @@ -985,7 +987,9 @@ { CHarvesterData* hd = iPHArray[i]; - if( aCheck && iHarvesterPluginFactory->IsContainerFileL( hd->Uri() ) ) + if( aCheck && + hd->Origin() != MdeConstants::Object::ECamera && + iHarvesterPluginFactory->IsContainerFileL( hd->Uri() ) ) { if( iContainerPHArray.Append( hd ) != KErrNone ) { @@ -1078,7 +1082,30 @@ if( objDefStr.Length() == 0 || ( objDefStr == KInUse ) ) { - WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - no objectDef or in use, failing harvesting" ); +#ifdef _DEBUG + if( objDefStr.Length() == 0 ) + { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - no objectDef failing harvesting" ); + } + else + { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - in use, failing harvesting" ); + } + WRITELOG1( "CHarvesterAO::HandlePlaceholdersL() - harvesting failed, uri: %S", &(hd->Uri()) ); +#endif + // If object has not been created in the device so that monitors would have + // picked up creation event, and the file is in use, subclose event will + // not trigger the file to be harvester when closed, thus it needs to be moved + // to reharvesting queue + if( objDefStr == KInUse && + !hd->TakeSnapshot() ) + { + iPHArray.Remove( i ); + i--; + endindex--; + iReHarvester->AddItem( hd ); + continue; + } const TInt error( KErrUnknown ); // notify observer, notification is needed even if file is not supported HarvestCompleted( hd->ClientId(), hd->Uri(), error ); @@ -1191,7 +1218,7 @@ } else { - mdeObject->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, KUndefinedMime ); + mdeObject->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, KUndefined ); } if( hd->Origin() == MdeConstants::Object::ECamera ) @@ -1213,7 +1240,7 @@ } else { - mdeObject->AddTextPropertyL( *iPropDefs->iTitlePropertyDef, KNullDesC ); + mdeObject->AddTextPropertyL( *iPropDefs->iTitlePropertyDef, KUndefined ); } CPlaceholderData* ph = NULL; @@ -1566,18 +1593,25 @@ WRITELOG( "CHarvesterAO::HarvestingCompleted() - Creating location object. " ); OstTrace0( TRACE_NORMAL, DUP6_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - Creating location object." ); - RLocationObjectManipulator lo; - - const TInt loError = lo.Connect(); + TInt loError( KErrNone ); + if( !iLocManipulatorConnected ) + { + loError = iLocManipulator.Connect(); + if( loError == KErrNone ) + { + iLocManipulatorConnected = ETrue; + } + } if (loError == KErrNone) { - TInt err = lo.CreateLocationObject( *locData, aHD->MdeObject().Id() ); + TInt err = iLocManipulator.CreateLocationObject( *locData, aHD->MdeObject().Id() ); if( err != KErrNone ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() - Location object creation failed!!!" ); OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - Location object creation failed!!!" ); - + iLocManipulator.Close(); + iLocManipulatorConnected = EFalse; } } else @@ -1585,8 +1619,6 @@ WRITELOG( "CHarvesterAO::HarvestingCompleted() - LocationObjectManipulator connect failed!!!" ); OstTrace0( TRACE_NORMAL, DUP8_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - LocationObjectManipulator connect failed!!" ); } - - lo.Close(); } TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 ) ); @@ -1793,31 +1825,38 @@ if( internalMassStorageError == KErrNone ) { const TUint32 massStorageMediaId( internalMassStorageVolumeInfo.iUniqueID ); - TUint32 mmcMediaId( 0 ); - TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ) ); - if( mmcError == KErrNone ) + if( massStorageMediaId != 0 ) { - TVolumeInfo mmcVolumeInfo; - mmcError = iFs.Volume( mmcVolumeInfo, drive ); + TUint32 mmcMediaId( 0 ); + TInt mmcDrive( -1 ); + TInt mmcError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) ); if( mmcError == KErrNone ) { - mmcMediaId = mmcVolumeInfo.iUniqueID; + if( drive != mmcDrive ) + { + TVolumeInfo mmcVolumeInfo; + mmcError = iFs.Volume( mmcVolumeInfo, mmcDrive ); + if( mmcError == KErrNone ) + { + mmcMediaId = mmcVolumeInfo.iUniqueID; + } + } + else + { + mmcMediaId = massStorageMediaId; + } } - } - // If removable storage is not found, assume internal mass storage was mounted - if( mmcError ) - { - if( massStorageMediaId != 0 ) + // If removable storage is not found, assume internal mass storage was mounted + if( mmcError ) + { + iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId ); + } + else if( massStorageMediaId != mmcMediaId ) { iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId ); - } - } - else if( massStorageMediaId != mmcMediaId && - massStorageMediaId != 0 ) - { - iMdEHarvesterSession->CheckMassStorageMediaId( massStorageMediaId ); - } + } + } } } } @@ -1882,11 +1921,6 @@ iHarvesterPluginFactory->PauseHarvester( ETrue ); iServerPaused = ETrue; - if( !iRamFull && !iDiskFull && !iUnmountDetected ) - { - iManualPauseEnabled = ETrue; - } - // Everything is paused WRITELOG( "CHarvesterAO::PauseHarvester() - Moving paused state paused" ); OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_PAUSEHARVESTER, "CHarvesterAO::PauseHarvester - Moving paused state paused" ); @@ -1902,17 +1936,19 @@ { WRITELOG( "CHarvesterAO::ResumeHarvesterL()" ); OstTrace0( TRACE_NORMAL, CHARVESTERAO_RESUMEHARVESTERL, "CHarvesterAO::ResumeHarvesterL" ); + + if( iRamFull || iDiskFull || iUnmountHandlingOngoing || iManualPauseEnabled ) + { + return; + } iHarvesterPluginFactory->PauseHarvester( EFalse ); iServerPaused = EFalse; - if( !iManualPauseEnabled && - iNextRequest == ERequestIdle ) + if( iNextRequest == ERequestIdle ) { SetNextRequest( ERequestHarvest ); - } - - iManualPauseEnabled = EFalse; + } } // --------------------------------------------------------------------------- @@ -1948,6 +1984,12 @@ iContainerPHArray.Compress(); iPHArray.Compress(); iTempReadyPHArray.Compress(); + + if( iLocManipulatorConnected ) + { + iLocManipulator.Close(); + iLocManipulatorConnected = EFalse; + } } break; @@ -2066,7 +2108,11 @@ while( i < count ) { CHarvesterData* hd = iContainerPHArray[0]; - iPHArray.Append( hd ); + if( iPHArray.Append( hd ) != KErrNone ) + { + delete hd; + hd = NULL; + } iContainerPHArray.Remove( 0 ); i++; } @@ -2093,6 +2139,7 @@ WRITELOG( "CHarvesterAO::RunL - ERequestPause" ); OstTrace0( TRACE_NORMAL, DUP6_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestPause" ); User::LeaveIfError( PauseHarvester() ); + iManualPauseEnabled = ETrue; iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStatePaused ); if( iHarvesterStatusObserver ) { @@ -2106,6 +2153,19 @@ { WRITELOG( "CHarvesterAO::RunL - ERequestResume" ); OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestResume" ); + iManualPauseEnabled = EFalse; + // If for some reason, mds session is not (yet) ready, only inform that + // server state is no longer paused, but do not restart actual harvesting + // yet. + if( !iMdeSessionInitialized ) + { + iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateResumed ); + if( iHarvesterStatusObserver ) + { + iHarvesterStatusObserver->ResumeReady( KErrNone ); + } + break; + } ResumeHarvesterL(); iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateResumed ); if( iHarvesterStatusObserver ) @@ -2303,7 +2363,7 @@ PauseMonitoring(); PauseHarvester(); } - else if( !iRamFull && !iManualPauseEnabled && iServerPaused ) + else if( iServerPaused ) { // resume monitoring ResumeMonitoring(); @@ -2874,7 +2934,6 @@ continue; } - //if (aMessage.Identity() == msg.Identity()) if( &req.iSession == &aSession ) { err = KErrNone; @@ -3395,9 +3454,10 @@ PauseMonitoring(); PauseHarvester(); - iPHArray.Compress(); - iReadyPHArray.Compress(); - iContainerPHArray.Compress(); + iReadyPHArray.Compress(); + iContainerPHArray.Compress(); + iPHArray.Compress(); + iTempReadyPHArray.Compress(); } void CHarvesterAO::MemoryGood() @@ -3407,7 +3467,7 @@ iRamFull = EFalse; - if( !iDiskFull && !iManualPauseEnabled && iServerPaused ) + if( iServerPaused ) { // resume monitoring ResumeMonitoring(); diff -r b73252188534 -r f23c07ec56e2 harvester/server/src/harvesterqueue.cpp --- a/harvester/server/src/harvesterqueue.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/src/harvesterqueue.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -144,7 +144,7 @@ WRITELOG( "CHarvesterQueue::Append()" ); TInt err( KErrNone ); - if ( iBlacklist ) + if ( iBlacklist && aItem->Origin() != MdeConstants::Object::ECamera ) { TUint32 mediaId( 0 ); err = iMediaIdUtil->GetMediaId( aItem->Uri(), mediaId ); diff -r b73252188534 -r f23c07ec56e2 harvester/server/src/harvesterserver.cpp --- a/harvester/server/src/harvesterserver.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/src/harvesterserver.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -162,7 +162,7 @@ WRITELOG( "CHarvesterServer::NewLC() - begin" ); CHarvesterServer* self = new (ELeave) CHarvesterServer( - KHarvesterServerSessionPriority, KHarvesterServerPolicy, + KHarvesterServerHighPriority, KHarvesterServerPolicy, ESharableSessions ); CleanupStack::PushL( self ); self->ConstructL(); diff -r b73252188534 -r f23c07ec56e2 harvester/server/src/ondemandao.cpp --- a/harvester/server/src/ondemandao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/src/ondemandao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -72,7 +72,7 @@ void COnDemandAO::DoCancel() { WRITELOG("COnDemandAO::DoCancel"); - iMdEHarvesterSession->CancelHarvestingPrioritizationObserver (); + iMdEHarvesterSession->CancelHarvestingPrioritizationObserver(); } void COnDemandAO::StartL() @@ -80,7 +80,7 @@ WRITELOG("COnDemandAO::StartL"); // Cancel any request, just to be sure Cancel (); - iMdEHarvesterSession->SetHarvestingPrioritizationChunkL ( 16384 ); + iMdEHarvesterSession->SetHarvestingPrioritizationChunkL( 16384 ); WaitHarvestingRequest (); } diff -r b73252188534 -r f23c07ec56e2 harvester/server/src/reharvesterao.cpp --- a/harvester/server/src/reharvesterao.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/harvester/server/src/reharvesterao.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -170,13 +170,7 @@ } } - CMdEObject* mdeObject = &aItem->MdeObject(); - if( mdeObject ) - { - delete mdeObject; - mdeObject = NULL; - aItem->SetMdeObject( NULL ); - } + aItem->SetMdeObject( NULL ); if(iItems.Append( aItem ) != KErrNone ) { diff -r b73252188534 -r f23c07ec56e2 inc/mdcdef.h --- a/inc/mdcdef.h Thu Aug 19 10:20:41 2010 +0300 +++ b/inc/mdcdef.h Tue Aug 31 15:37:30 2010 +0300 @@ -25,7 +25,7 @@ NONSHARABLE_CLASS(TMdCDef) : protected TMdCSerializationType { protected: - TMdCDef(TMdCStructTypes aType) : TMdCSerializationType( aType ) + TMdCDef(TMdCStructTypes aType) : TMdCSerializationType( aType ), iDefId( 0 ) { } diff -r b73252188534 -r f23c07ec56e2 inc/mdscommoninternal.h --- a/inc/mdscommoninternal.h Thu Aug 19 10:20:41 2010 +0300 +++ b/inc/mdscommoninternal.h Tue Aug 31 15:37:30 2010 +0300 @@ -45,6 +45,9 @@ const TItemId KSystemFavouritesAlbumId = 1; +_LIT( KSystemFavouritesAlbumUri, "defaultalbum_favourites" ); +_LIT( KSystemCapturedAlbumUri, "defaultalbum_captured" ); + const TInt KMaxUintValueLength = 10; const TInt KMaxUint64ValueLength = 20; @@ -69,7 +72,7 @@ const TUint32 KNokiaVendorId = 52487775; -const TInt64 KDiskFullThreshold = 1024*50; // 50 kB +const TInt64 KDiskFullThreshold = 1024*70; // 70 kB, SQLite default maximum journal size // P&S stuff static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); diff -r b73252188534 -r f23c07ec56e2 locationmanager/data/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/data/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2010 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: Build information file +* +*/ +#include "../inc/locplatsupport.mmh" + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS +200071BE.txt /epoc32/data/z/private/10202BE9/200071BE.txt +200071BE.txt /epoc32/WINSCW/C/private/10202BE9/200071BE.txt +../sis/locationmanager_stub.sis /epoc32/data/z/system/install/locationmanager_stub.sis + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + diff -r b73252188534 -r f23c07ec56e2 locationmanager/group/bld.inf --- a/locationmanager/group/bld.inf Thu Aug 19 10:20:41 2010 +0300 +++ b/locationmanager/group/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -14,7 +14,8 @@ * Description: Build information file * */ -#include "../inc/locplatsupport.mmh" + +#include "../data/bld.inf" #ifdef _LOC_GEOTAGGING_CELLID #include "../geoconverter/group/bld.inf" @@ -35,9 +36,6 @@ DEFAULT PRJ_EXPORTS -../data/200071BE.txt /epoc32/data/z/private/10202BE9/200071BE.txt -../data/200071BE.txt /epoc32/WINSCW/C/private/10202BE9/200071BE.txt -../sis/locationmanager_stub.sis /epoc32/data/z/system/install/locationmanager_stub.sis PRJ_MMPFILES diff -r b73252188534 -r f23c07ec56e2 locationmanager/inc/locplatsupport.mmh --- a/locationmanager/inc/locplatsupport.mmh Thu Aug 19 10:20:41 2010 +0300 +++ b/locationmanager/inc/locplatsupport.mmh Tue Aug 31 15:37:30 2010 +0300 @@ -27,7 +27,7 @@ /* * Define this flag when platform supports reverse geotagging. */ -#define _LOC_REVERSEGEOCODE +//#define _LOC_REVERSEGEOCODE #endif // __LOCPLATSUPPORT_MMH__ diff -r b73252188534 -r f23c07ec56e2 locationmanager/locationtrail/src/clocationrecord.cpp --- a/locationmanager/locationtrail/src/clocationrecord.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/locationmanager/locationtrail/src/clocationrecord.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -509,7 +509,7 @@ if ( !iTrailStarted || iState == RLocationTrail::ETrailStopped) { - LOG("trail not started/stopped"); + LOG("CLocationRecord::Position(), trail not started/stopped"); iPositionInfo->Stop(); return; } @@ -533,24 +533,24 @@ case KPositionQualityLoss: { // Location is stored, even if it may not be valid. - LOG("Partial update"); + LOG("CLocationRecord::Position(), Partial update"); if ( iState != RLocationTrail::EWaitingGPSData && iState != RLocationTrail::ETrailStopping ) { SetCurrentState( RLocationTrail::EWaitingGPSData ); - LOG("Trail waiting for gps"); + LOG("CLocationRecord::Position(), Trail waiting for gps"); } break; } case KErrNone: { - LOG("Good GPS coordinates"); + LOG("CLocationRecord::Position(), Good GPS coordinates"); iGpsDataAvailableFlag = ETrue; if ( iState != RLocationTrail::ETrailStarted ) { if ( iRemapper ) { - LOG("Start remapping"); + LOG("CLocationRecord::Position(), Start remapping"); iRemapper->StartRemappingObjects( iNewItem.iLocationData ); if( iObserver->WaitForPositioningStopTimeout() && !RemappingNeeded() ) @@ -571,7 +571,7 @@ } default: { - LOG1("Searching GPS, aError %d", aError ); + LOG1("CLocationRecord::Position(), Searching GPS, aError %d", aError ); if ( iState != RLocationTrail::ESearchingGPS && iState != RLocationTrail::ETrailStopping ) { @@ -582,12 +582,12 @@ } } TBool fixState = CheckGPSFix( positionSatelliteInfo ); - LOG1( "fixState %d", fixState ); - LOG1( "iLastGPSFixState %d", iLastGPSFixState ); + LOG1( "CLocationRecord::Position(), fixState %d", fixState ); + LOG1( "CLocationRecord::Position(), iLastGPSFixState %d", iLastGPSFixState ); if ( iObserver && iLastGPSFixState != fixState ) { - LOG("Quality changed"); + LOG("CLocationRecord::Position(), Quality changed"); iObserver->GPSSignalQualityChanged( positionSatelliteInfo ); } @@ -968,7 +968,7 @@ { // no n/w info... put it into remap. // remove the last appended element. - LOG("No network info (offline mode + no GPS fix), keep for remapping"); + LOG("CLocationRecord::LocationSnapshotL(), No network info (offline mode + no GPS fix), keep for remapping"); TRemapItem remapItem; remapItem.iObjectId = aObjectId; remapItem.iTime = timestamp; @@ -977,7 +977,12 @@ TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; iMediaItems.Remove(iMediaItems.Count() - 1); iMediaItems.Compress(); - delete firstPtr; + if( firstPtr == newItem) + { + newItem = NULL; + } + delete firstPtr; + firstPtr = NULL; } else { @@ -988,6 +993,7 @@ else if ( Math::IsNaN( locationData.iPosition.Latitude() ) && Math::IsNaN( locationData.iPosition.Longitude() )) { + LOG("CLocationRecord::LocationSnapshotL(), coordinates empty with or without cellular info") // coordinates empty, with or without cellular info if ( net->iCellId == 0 && @@ -995,7 +1001,7 @@ net->iCountryCode.Length() == 0 && net->iNetworkId.Length() == 0 ) { - LOG("No network info (offline mode + no GPS fix), keep for remapping"); + LOG("CLocationRecord::LocationSnapshotL(), No network info (offline mode + no GPS fix), keep for remapping"); TRemapItem remapItem; remapItem.iObjectId = aObjectId; remapItem.iTime = timestamp; @@ -1004,7 +1010,12 @@ TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; iMediaItems.Remove(iMediaItems.Count() - 1); iMediaItems.Compress(); - delete firstPtr; + if( firstPtr == newItem) + { + newItem = NULL; + } + delete firstPtr; + firstPtr = NULL; } // check match for last created locationobject #ifdef LOC_REVERSEGEOCODE @@ -1014,6 +1025,7 @@ else if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0) #endif //LOC_REVERSEGEOCODE { + LOG("CLocationRecord::LocationSnapshotL(), last created locationobject match" ); TLocationData lastLocationData = iLastMediaItem.iLocationData; CTelephony::TNetworkInfoV1* lastnet = &lastLocationData.iNetworkInfo; @@ -1038,11 +1050,16 @@ TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; iMediaItems.Remove(iMediaItems.Count() - 1); iMediaItems.Compress(); - delete firstPtr; + if( firstPtr == newItem) + { + newItem = NULL; + } + delete firstPtr; + firstPtr = NULL; } } - if ( !previousMatch ) + if ( newItem && !previousMatch ) { // go for n/w based newItem->iFlag |= KNetQueryBit; @@ -1053,6 +1070,7 @@ else if ( lastLocationId != 0 && ((iLastMediaItem.iFlag & KSnapMediaFile) > 0)) { + LOG("CLocationRecord::LocationSnapshotL(), valid coordinates found"); TLocationData lastLocationData = iLastMediaItem.iLocationData; CTelephony::TNetworkInfoV1* lastnet = &lastLocationData.iNetworkInfo; @@ -1078,7 +1096,7 @@ if ( distance < iLocationDelta ) { - LOG("location close to the previous one"); + LOG("CLocationRecord::LocationSnapshotL(), location close to the previous one"); previousMatch = ETrue; CreateRelationL( aObjectId, lastLocationId ); @@ -1091,9 +1109,14 @@ TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; iMediaItems.Remove(iMediaItems.Count() - 1); iMediaItems.Compress(); - delete firstPtr; + if( firstPtr == newItem) + { + newItem = NULL; + } + delete firstPtr; + firstPtr = NULL; } - else + else if (newItem) { // country tag not found.. go for reverse geocoding.. newItem->iLocationId = lastLocationId; @@ -1117,7 +1140,12 @@ TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; iMediaItems.Remove(iMediaItems.Count() - 1); iMediaItems.Compress(); - delete firstPtr; + if( firstPtr == newItem) + { + newItem = NULL; + } + delete firstPtr; + firstPtr = NULL; #endif //LOC_REVERSEGEOCODE } @@ -1193,7 +1221,7 @@ || (iMediaItems.Count() <= 0)) { // query is in progress or queue is empty - LOG1( "query is in progress or queue is empty. Count - %d", iMediaItems.Count() ); + LOG1( "CLocationRecord::FindLocationFromDBL(), Count - %d", iMediaItems.Count() ); return; } if ( (iMediaItems[0]->iFlag & KNetQueryBit) > 0 ) @@ -1236,10 +1264,10 @@ CMdELogicCondition& cond = iLocationQuery->Conditions(); cond.SetOperator( ELogicConditionOperatorAnd ); - LOG1( "latitude: %f", latitude); - LOG1( "latdelta: %f", latDelta); - LOG1( "longitude: %f", longitude); - LOG1( "londelta: %f", lonDelta); + LOG1( "CLocationRecord::FindLocationFromDBL(), latitude: %f", latitude); + LOG1( "CLocationRecord::FindLocationFromDBL(), latdelta: %f", latDelta); + LOG1( "CLocationRecord::FindLocationFromDBL(), longitude: %f", longitude); + LOG1( "CLocationRecord::FindLocationFromDBL(), londelta: %f", lonDelta); cond.AddPropertyConditionL( *iLatitudeDef, TMdERealBetween( latitude - latDelta, latitude + latDelta )); @@ -1329,14 +1357,14 @@ locationObject->AddTextPropertyL( itemTypeDef, Location::KLocationItemType ); locationObject->AddInt16PropertyL( offSetDef, timeOffset.Int() / 60 ); - LOG1( "Location created with stamp: %Ld", timestamp.Int64() ); + LOG1( "CLocationRecord::DoCreateLocationL(), Location created with stamp: %Ld", timestamp.Int64() ); // location related properties if ( !Math::IsNaN( aLocationData.iPosition.Latitude() ) && !Math::IsNaN( aLocationData.iPosition.Longitude() )) { - LOG1("Lan - %f", aLocationData.iPosition.Latitude()); - LOG1("Lon - %f", aLocationData.iPosition.Longitude()); + LOG1("CLocationRecord::DoCreateLocationL(), Lan - %f", aLocationData.iPosition.Latitude()); + LOG1("CLocationRecord::DoCreateLocationL(), Lon - %f", aLocationData.iPosition.Longitude()); locationObject->AddReal64PropertyL( *iLatitudeDef, aLocationData.iPosition.Latitude() ); locationObject->AddReal64PropertyL( *iLongitudeDef, aLocationData.iPosition.Longitude() ); @@ -1361,29 +1389,44 @@ // network related properties if ( aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown ) { - LOG1("Cell id - %d", aLocationData.iNetworkInfo.iCellId); + LOG1("CLocationRecord::DoCreateLocationL(), Cell id - %d", aLocationData.iNetworkInfo.iCellId); locationObject->AddUint32PropertyL( cellIdDef, aLocationData.iNetworkInfo.iCellId ); } if ( aLocationData.iNetworkInfo.iAreaKnown && aLocationData.iNetworkInfo.iLocationAreaCode != 0 && aLocationData.iNetworkInfo.iAccess != CTelephony::ENetworkAccessUnknown ) { - LOG1("Areacode - %d", aLocationData.iNetworkInfo.iLocationAreaCode); + LOG1("CLocationRecord::DoCreateLocationL(), Areacode - %d", aLocationData.iNetworkInfo.iLocationAreaCode); locationObject->AddUint32PropertyL( locationCodeDef, aLocationData.iNetworkInfo.iLocationAreaCode ); } #ifdef _DEBUG - TLex lexer( aLocationData.iNetworkInfo.iCountryCode ); - TUint countryCode = 0; - - User::LeaveIfError( lexer.Val( countryCode, EDecimal) ); - LOG1("Country code - %d", countryCode); + + if ( aLocationData.iNetworkInfo.iCountryCode.Length() > 0 ) + { + TLex lexer( aLocationData.iNetworkInfo.iCountryCode ); + TUint countryCode = 0; + TRAP_IGNORE(lexer.Val( countryCode, EDecimal)); + LOG1("CLocationRecord::DoCreateLocationL(), Country code - %d", countryCode); + } + else + { + LOG("CLocationRecord::DoCreateLocationL(), No Country code"); + } //Set mobile network code - lexer = aLocationData.iNetworkInfo.iNetworkId; - TUint networkCode = 0; - User::LeaveIfError( lexer.Val( networkCode, EDecimal) ); - LOG1("Network id - %d", networkCode); + if ( aLocationData.iNetworkInfo.iNetworkId.Length() > 0 ) + { + TLex lexer = aLocationData.iNetworkInfo.iNetworkId; + TUint networkCode = 0; + TRAP_IGNORE(lexer.Val( networkCode, EDecimal)); + LOG1("CLocationRecord::DoCreateLocationL(), Network id - %d", networkCode); + } + else + { + LOG("CLocationRecord::DoCreateLocationL(), No network code"); + } + #endif if ( aLocationData.iNetworkInfo.iCountryCode.Length() > 0 ) { @@ -1398,7 +1441,7 @@ // Add the location object to the database. locationObjectId = iMdeSession->AddObjectL( *locationObject ); - LOG1("Location id - %d", locationObjectId); + LOG1("CLocationRecord::DoCreateLocationL(), Location id - %d", locationObjectId); CleanupStack::PopAndDestroy( locationObject ); LOG( "CLocationRecord::DoCreateLocationL(), end" ); @@ -2197,6 +2240,11 @@ CMdEProperty* property = NULL; object = iMdeSession->GetObjectL( aObjectId ); + if( !object ) + { + User::Leave( KErrNotFound ); + } + CleanupStack::PushL( object ); object->Property( timeDef, property, 0 ); if ( !property ) @@ -2206,7 +2254,10 @@ const TTime timeValue( property->TimeValueL() ); CleanupStack::PopAndDestroy( object ); + + LOG( "CLocationRecord::GetMdeObjectTimeL(), end" ); return timeValue; + } diff -r b73252188534 -r f23c07ec56e2 mds_plat/harvester_framework_api/inc/harvesterplugin.h --- a/mds_plat/harvester_framework_api/inc/harvesterplugin.h Thu Aug 19 10:20:41 2010 +0300 +++ b/mds_plat/harvester_framework_api/inc/harvesterplugin.h Tue Aug 31 15:37:30 2010 +0300 @@ -160,6 +160,11 @@ * @param aBlacklist Reference to blacklisting component. */ IMPORT_C virtual void SetBlacklist( CHarvesterBlacklist& aBlacklist ); + + /** + * Method to stop harvester plugin if needed. + */ + IMPORT_C virtual void StopHarvest(); protected: @@ -265,6 +270,7 @@ CMdEPropertyDef* iTitlePropertyDef; TBool iHarvesting; + TBool iPaused; }; diff -r b73252188534 -r f23c07ec56e2 mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp --- a/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp Thu Aug 19 10:20:41 2010 +0300 +++ b/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp Tue Aug 31 15:37:30 2010 +0300 @@ -27,7 +27,7 @@ CAPABILITY ALL -TCB VENDORID VID_DEFAULT -DEFFILE LocationManagerTestScripter.DEF +DEFFILE LocationManagerTestScripter.def #ifdef _LOC_REVERSEGEOCODE MACRO LOC_REVERSEGEOCODE diff -r b73252188534 -r f23c07ec56e2 metadataengine/client/src/mdeharvestersession.cpp --- a/metadataengine/client/src/mdeharvestersession.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/client/src/mdeharvestersession.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -138,8 +138,10 @@ WRITELOG( "CMdEHarvesterSession::SetFilesToPresentL -- Start" ); if( aUris.Count() != aFileInfos.Count() ) { +#ifdef _DEBUG WRITELOG2( "CMdEHarvesterSession::SetFilesToPresentL -- Leave (%d, %d)", aUris.Count(), aFileInfos.Count() ); +#endif User::Leave( KErrArgument ); } diff -r b73252188534 -r f23c07ec56e2 metadataengine/data/schema.mde --- a/metadataengine/data/schema.mde Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/data/schema.mde Tue Aug 31 15:37:30 2010 +0300 @@ -166,13 +166,13 @@ property Duration 0 0 8 min max property ReleaseDate 0 0 10 min max property CaptureDate 0 0 10 min max -property Artist 0 0 11 min max +property Artist 0 0 11 min max 1 property Author 0 0 11 min max property Copyright 0 0 11 min max property Legal 0 0 11 min max property Description 0 0 11 min max property Comment 0 0 11 min max -property Genre 0 0 11 min max +property Genre 0 0 11 min max 1 property Track 0 0 4 min max property AudioFourCC 0 0 6 min max @@ -231,8 +231,8 @@ object http://sw.nokia.com/MdE Audio MediaObject 0 property SamplingFrequency 0 0 8 min max -property Album 0 0 11 min max -property Composer 0 0 11 min max +property Album 0 0 11 min max 1 +property Composer 0 0 11 min max 1 property OriginalArtist 0 0 11 min max property AlbumArtist 0 0 11 min max diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/inc/mdssqldbmaintenance.h --- a/metadataengine/server/inc/mdssqldbmaintenance.h Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/inc/mdssqldbmaintenance.h Tue Aug 31 15:37:30 2010 +0300 @@ -55,6 +55,11 @@ * Drops and re-creates tables */ void CreateDatabaseL(); + + /** + * Does quick check to the existing database to detect obvious corruption + */ + TBool CheckForCorruptionL(); }; #endif // __MDSSQLDBMAINTENANCE_H__ diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/inc/mdssqlobjectmanipulate.h --- a/metadataengine/server/inc/mdssqlobjectmanipulate.h Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/inc/mdssqlobjectmanipulate.h Tue Aug 31 15:37:30 2010 +0300 @@ -523,6 +523,15 @@ * Deletes BaseObject. */ TBool DoGarbageCollectionL(); + +#ifdef MDS_PLAYLIST_HARVESTING_ENABLED + private: + + /** + * Deletes BaseObject. + */ + TInt CleanPlaylistsL(); +#endif private: // Member data struct TLockBuffer diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdsfindsequence.cpp --- a/metadataengine/server/src/mdsfindsequence.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdsfindsequence.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -15,6 +15,7 @@ */ #include +#include #include "mdsfindsequence.h" @@ -72,7 +73,7 @@ , iObserver( &aObserver ) , iUserLevel( EUserLevelNone ) { - iNotifyCount = KMaxTUint32; + iNotifyCount = KMdEQueryDefaultMaxCount; iFindOperation = NULL; } diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdsmaintenanceengine.cpp --- a/metadataengine/server/src/mdsmaintenanceengine.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdsmaintenanceengine.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -120,7 +120,7 @@ TBool isValid(EFalse); TRAPD(err, isValid = iMaintenance->ValidateL( )); - if(err == KErrCorrupt) + if( err == KErrCorrupt ) { DeleteDatabase(); User::Leave( err ); @@ -174,11 +174,6 @@ User::Leave( schemaError ); } } - - if ( FailedImports() != 0 ) - { - User::Leave( KErrBadName ); - } // try to read default import file from C drive TRAPD( err, ImportMetadataL( aManipulate, aSchema, KMdsDefaultImportFile ) ); @@ -188,6 +183,13 @@ // and ignore errors TRAP_IGNORE( ImportMetadataL( aManipulate, aSchema, KMdsDefaultRomImportFile ) ); } + +#ifdef _DEBUG + if ( FailedImports() != 0 ) + { + User::Leave( KErrBadName ); + } +#endif __LOG1( ELogAlways, "MDS DB tables created %d", 0 ); @@ -206,6 +208,12 @@ DeleteDatabase(); User::Leave( err ); } + + if( !iMaintenance->CheckForCorruptionL() ) + { + DeleteDatabase(); + User::Leave( KErrCorrupt ); + } } __LOG1( ELogAlways, "CMdSMaintenanceEngine::InstallL complete: %d", 0 ); } diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdsmanipulationengine.cpp --- a/metadataengine/server/src/mdsmanipulationengine.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdsmanipulationengine.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -852,11 +852,11 @@ #ifdef _DEBUG const TInt64 time = fileInfo.iModifiedTime; - RDebug::Print( _L("CMdSManipulationEngine::SetFilesToPresentL: (%d) iSize %u, iModified %Ld, uri %S"), + RDebug::Print( _L("CMdSManipulationEngine::SetFilesToPresentL: (%d) uri %S, iSize %u, iModified %Ld"), i, + &uri, fileInfo.iSize, - time, - &uri); + time ); #endif TFilePresentStates placeHolder; diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdsnotifycomparator.cpp --- a/metadataengine/server/src/mdsnotifycomparator.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdsnotifycomparator.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -1180,7 +1180,7 @@ { aSerializedCondition.PositionL( aRelationCondition.iRelationIds.iPtr.iOffset ); - for (TInt i = 0; i < aRelationCondition.iRelationIds.iPtr.iCount; ++i) + for (TUint i = 0; i < aRelationCondition.iRelationIds.iPtr.iCount; ++i) { TItemId relationId; aSerializedCondition.ReceiveL( relationId ); diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdssqldbmaintenance.cpp --- a/metadataengine/server/src/mdssqldbmaintenance.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdssqldbmaintenance.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -188,7 +188,6 @@ } } CleanupStack::PopAndDestroy( &col2propQuery ); - emptyRowData.Reset(); CleanupStack::PopAndDestroy( &emptyRowData ); @@ -227,3 +226,49 @@ CleanupStack::PopAndDestroy( &emptyRowData ); } +TBool CMdSSqlDbMaintenance::CheckForCorruptionL() + { + // Check the MDS default namespace main table for validity + // This table should always contain at least 1 default system folder object + _LIT( KValidateData, "SELECT COUNT(*) FROM Object%u;" ); + + RBuf commonClauseOne; + User::LeaveIfError( commonClauseOne.Create( KValidateData.iTypeLength + KMaxUintValueLength ) ); + CleanupClosePushL( commonClauseOne ); + commonClauseOne.Format( KValidateData, KDefaultNamespaceDefId ); + + RRowData emptyRowData; + CleanupClosePushL( emptyRowData ); + + RMdsStatement validationQuery; + CleanupClosePushL( validationQuery ); + + CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL(); + + TInt test( KErrNone ); + TUint32 count( 0 ); + TRAP( test, connection.ExecuteQueryL( commonClauseOne, validationQuery, emptyRowData ) ); + if( test == KErrNone ) + { + emptyRowData.AppendL( TColumn( count ) ); + TRAP( test, connection.NextRowL(validationQuery, emptyRowData)); + if(test == KErrNone) + { + emptyRowData.Column(0).Get( count ); + + if(count <= 0) + { + test = KErrCorrupt; + } + } + } + + CleanupStack::PopAndDestroy( &validationQuery ); + + CleanupStack::PopAndDestroy( &emptyRowData ); + + CleanupStack::PopAndDestroy( &commonClauseOne ); + + return ( test == KErrNone ); + } + diff -r b73252188534 -r f23c07ec56e2 metadataengine/server/src/mdssqlobjectmanipulate.cpp --- a/metadataengine/server/src/mdssqlobjectmanipulate.cpp Thu Aug 19 10:20:41 2010 +0300 +++ b/metadataengine/server/src/mdssqlobjectmanipulate.cpp Tue Aug 31 15:37:30 2010 +0300 @@ -2271,8 +2271,8 @@ TPtrC16 uri = aBuffer.ReceivePtr16L(); objectId = SearchObjectByUriL( uri, flags ); if ( objectId != KNoId && - objectId != KSystemFavouritesAlbumId && - objectId != KSystemCapturedAlbumId ) + uri != KSystemFavouritesAlbumUri && + uri != KSystemCapturedAlbumUri ) { // unlock object, so update is no possible anymore if ( iLockList.IsLocked( *iNamespaceDef, objectId ) ) @@ -3431,7 +3431,13 @@ // rowDataDel, commonClauseOne CleanupStack::PopAndDestroy( 7, &commonClauseOne ); - // When this is reached, all garbage collection steps have been fully executed +#ifdef MDS_PLAYLIST_HARVESTING_ENABLED + if( updateResult == 0 ) + { + updateResult = CleanPlaylistsL(); + } +#endif + return EFalse; } @@ -3441,6 +3447,42 @@ db.DoAnalyzeL(); } +#ifdef MDS_PLAYLIST_HARVESTING_ENABLED +TInt CMdSSqlObjectManipulate::CleanPlaylistsL() + { + _LIT( KDeleteWholePlaylists, "DELETE FROM Object%u WHERE ObjectId IN (SELECT ObjectId FROM AudioPlaylistItem%u WHERE PlaylistID NOT IN (SELECT ObjectId FROM Object%u));" ); + + RClauseBuffer commonClauseOne(*this, KDeleteWholePlaylists().Length()); + CleanupClosePushL( commonClauseOne ); + CMdsClauseBuffer& buffer = commonClauseOne.BufferL(); + + RRowData rowDataDel; + CleanupClosePushL( rowDataDel ); + + const RPointerArray& namespaceDefs = + iSchema.NamespaceDefs(); + + CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL(); + const TInt updateResult = 0; // once all files to be cleaned are handled, no need to continue + + const TInt count = namespaceDefs.Count(); + + for( TInt i = 0; i < count; ++i ) + { + const TDefId nmspId = namespaceDefs[i]->GetId(); + + buffer.BufferL().Format( KDeleteWholePlaylists, nmspId, nmspId, nmspId ); + User::LeaveIfError( connection.ExecuteL( + buffer.ConstBufferL(), rowDataDel ) ); + } + + // rowDataDel, commonClauseOne + CleanupStack::PopAndDestroy( 2, &commonClauseOne ); + + return updateResult; + } +#endif + CMdSSqlObjectManipulate::RClauseBuffer::RClauseBuffer( CMdSSqlObjectManipulate& aSOM, TInt aSize ) : iBuffers( aSOM.iBuffers ), iBuffer( NULL ), iNr( -1 ), iSize( aSize ) { diff -r b73252188534 -r f23c07ec56e2 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r b73252188534 -r f23c07ec56e2 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,1 @@ + diff -r b73252188534 -r f23c07ec56e2 rom/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/bld.inf Tue Aug 31 15:37:30 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 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: Build information file +* +*/ + + +#include +#include "../locationmanager/inc/locplatsupport.mmh" + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS + +#if defined(_LOC_GEOTAGGING_CELLID) +#ifdef _LOC_REVERSEGEOCODE +mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#else +mds_cellidenabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif +#elif defined(_LOC_REVERSEGEOCODE) +#ifdef _LOC_GEOTAGGING_CELLID +mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#else +mds_reverse_geocode_enabled_only.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif +#else +mds.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif + +#ifdef RD_MDS_2_5 +ContentListingFramework.iby CORE_MW_LAYER_IBY_EXPORT_PATH( ContentListingFramework.iby ) +#endif + +//Stubs +../sis/mds/mds_stub.sis /epoc32/data/z/system/install/mds_stub.sis + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS +mds_testers.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds_testers.iby) + diff -r b73252188534 -r f23c07ec56e2 rom/mds_cellid_reverse_geocode_enabled.iby --- a/rom/mds_cellid_reverse_geocode_enabled.iby Thu Aug 19 10:20:41 2010 +0300 +++ b/rom/mds_cellid_reverse_geocode_enabled.iby Tue Aug 31 15:37:30 2010 +0300 @@ -121,16 +121,4 @@ data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis -data=ZSYSTEM\install\locationmanagerclient_stub.sis system\install\locationmanagerclient_stub.sis -data=ZSYSTEM\install\locationtrail_stub.sis system\install\locationtrail_stub.sis -data=ZSYSTEM\install\locationmanagerserver_stub.sis system\install\locationmanagerserver_stub.sis - -data=ZSYSTEM\install\ReverseGeocode_stub.sis system\install\ReverseGeocode_stub.sis -data=ZSYSTEM\install\ReverseGeoCoderPlugin_stub.sis system\install\ReverseGeoCoderPlugin_stub.sis -data=ZSYSTEM\install\tagcreator_stub.sis system\install\tagcreator_stub.sis -data=ZSYSTEM\install\geotagger_stub.sis system\install\geotagger_stub.sis -data=ZSYSTEM\install\geoconverter_stub.sis system\install\geoconverter_stub.sis - - - #endif //__METADATA_IBY__ diff -r b73252188534 -r f23c07ec56e2 rom/mds_reverse_geocode_enabled_only.iby --- a/rom/mds_reverse_geocode_enabled_only.iby Thu Aug 19 10:20:41 2010 +0300 +++ b/rom/mds_reverse_geocode_enabled_only.iby Tue Aug 31 15:37:30 2010 +0300 @@ -118,11 +118,4 @@ data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis -data=ZSYSTEM\install\locationmanagerclient_stub.sis system\install\locationmanagerclient_stub.sis -data=ZSYSTEM\install\locationtrail_stub.sis system\install\locationtrail_stub.sis -data=ZSYSTEM\install\locationmanagerserver_stub.sis system\install\locationmanagerserver_stub.sis -data=ZSYSTEM\install\ReverseGeocode_stub.sis system\install\ReverseGeocode_stub.sis -data=ZSYSTEM\install\ReverseGeoCoderPlugin_stub.sis system\install\ReverseGeoCoderPlugin_stub.sis -data=ZSYSTEM\install\tagcreator_stub.sis system\install\tagcreator_stub.sis -data=ZSYSTEM\install\geotagger_stub.sis system\install\geotagger_stub.sis #endif //__METADATA_IBY__ diff -r b73252188534 -r f23c07ec56e2 sis/mds/mds_stub.sis Binary file sis/mds/mds_stub.sis has changed diff -r b73252188534 -r f23c07ec56e2 sis/mds/package.pkg --- a/sis/mds/package.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/package.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 26, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r b73252188534 -r f23c07ec56e2 sis/mds/package_cellid_reverse_geocode_enabled.pkg --- a/sis/mds/package_cellid_reverse_geocode_enabled.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/package_cellid_reverse_geocode_enabled.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 26, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r b73252188534 -r f23c07ec56e2 sis/mds/package_cellidenabled.pkg --- a/sis/mds/package_cellidenabled.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/package_cellidenabled.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 26, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r b73252188534 -r f23c07ec56e2 sis/mds/package_reverse_geocode_enabled_only.pkg --- a/sis/mds/package_reverse_geocode_enabled_only.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/package_reverse_geocode_enabled_only.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 26, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r b73252188534 -r f23c07ec56e2 sis/mds/package_separate.pkg --- a/sis/mds/package_separate.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/package_separate.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 9, 20, 26, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 13, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r b73252188534 -r f23c07ec56e2 sis/mds/stub.pkg --- a/sis/mds/stub.pkg Thu Aug 19 10:20:41 2010 +0300 +++ b/sis/mds/stub.pkg Tue Aug 31 15:37:30 2010 +0300 @@ -17,7 +17,7 @@ &EN ; Header -#{"Metadata System"}, (0x200009F5), 9, 20, 26, TYPE=SA +#{"Metadata System"}, (0x200009F5), 10, 10, 13, TYPE=SA ; Localised Vendor name %{"Nokia"}