diff -r 63c982fb92f2 -r b73252188534 harvester/common/src/harvesterpluginfactory.cpp --- a/harvester/common/src/harvesterpluginfactory.cpp Thu Jul 15 19:07:24 2010 +0300 +++ b/harvester/common/src/harvesterpluginfactory.cpp Thu Aug 19 10:20:41 2010 +0300 @@ -93,50 +93,9 @@ // GetObjectDef // --------------------------------------------------------------------------- // -EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData& aHD, TDes& aObjectDef ) +EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData& /*aHD*/, TDes& aObjectDef ) { - TPtrC extPtr; - if( MdsUtils::GetExt( aHD.Uri(), extPtr ) ) - { - RPointerArray supportedPlugins; - CleanupClosePushL( supportedPlugins ); - GetSupportedPluginsL( supportedPlugins, extPtr ); - - const TInt sCount = supportedPlugins.Count(); - if( sCount == 1 ) - { - CHarvesterPluginInfo* info = supportedPlugins[0]; - if( info->iObjectTypes.Count() == 1 ) - { - aObjectDef.Copy( *(info->iObjectTypes[0]) ); - aHD.SetHarvesterPluginInfo( info ); - CleanupStack::PopAndDestroy( &supportedPlugins ); - return; - } - } - for( TInt i = sCount - 1; i >=0; i-- ) - { - CHarvesterPluginInfo* info = supportedPlugins[i]; - if ( !(info->iPlugin) ) - { - info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid ); - info->iPlugin->SetQueue( info->iQueue ); - info->iPlugin->SetHarvesterPluginFactory( *this ); - info->iPlugin->SetBlacklist( *iBlacklist ); - } - info->iPlugin->GetObjectType( aHD.Uri(), aObjectDef ); - if( aObjectDef.Length() > 0 ) - { - aHD.SetHarvesterPluginInfo( info ); - break; - } - } - CleanupStack::PopAndDestroy( &supportedPlugins ); - } - else - { - aObjectDef.Zero(); - } + aObjectDef.Zero(); } // --------------------------------------------------------------------------- @@ -209,7 +168,8 @@ if( aHD->ObjectType() == EFastHarvest || aHD->Origin() == MdeConstants::Object::ECamera ) { - hpi->iQueue.Insert( aHD, 0 ); + hpi->iQueue.InsertL( aHD, 0 ); + if( !hpi->iPlugin->IsActive() ) { hpi->iPlugin->SetPriority( KHarvesterPriorityHarvestingPlugin + 1 ); @@ -328,11 +288,9 @@ pluginInfo->iPluginUid = aPluginUid; -#ifdef MDS_HARVESTERPLUGINS_ON_BOOT pluginInfo->iPlugin = CHarvesterPlugin::NewL( pluginInfo->iPluginUid ); pluginInfo->iPlugin->SetQueue( pluginInfo->iQueue ); pluginInfo->iPlugin->SetHarvesterPluginFactory( *this ); -#endif iHarvesterPluginInfoArray.AppendL( pluginInfo ); CleanupStack::Pop( pluginInfo ); @@ -491,3 +449,54 @@ } } +EXPORT_C void CHarvesterPluginFactory::GetObjectDefL( CHarvesterData* aHD, TDes& aObjectDef ) + { + TPtrC extPtr; + if( MdsUtils::GetExt( aHD->Uri(), extPtr ) ) + { + RPointerArray supportedPlugins; + CleanupClosePushL( supportedPlugins ); + GetSupportedPluginsL( supportedPlugins, extPtr ); + + const TInt sCount = supportedPlugins.Count(); + if( sCount == 1 ) + { + CHarvesterPluginInfo* info = supportedPlugins[0]; + if( info->iObjectTypes.Count() == 1 ) + { + aObjectDef.Copy( *(info->iObjectTypes[0]) ); + aHD->SetHarvesterPluginInfo( info ); + CleanupStack::PopAndDestroy( &supportedPlugins ); + return; + } + } + for( TInt i = sCount - 1; i >=0; i-- ) + { + CHarvesterPluginInfo* info = supportedPlugins[i]; + if ( !(info->iPlugin) ) + { + info->iPlugin = CHarvesterPlugin::NewL( info->iPluginUid ); + info->iPlugin->SetQueue( info->iQueue ); + info->iPlugin->SetHarvesterPluginFactory( *this ); + info->iPlugin->SetBlacklist( *iBlacklist ); + } + info->iPlugin->GetObjectType( aHD->Uri(), aObjectDef ); + if( aHD && aObjectDef.Length() > 0 ) + { + aHD->SetHarvesterPluginInfo( info ); + break; + } + else if( !aHD ) + { + break; + } + } + CleanupStack::PopAndDestroy( &supportedPlugins ); + } + else + { + aObjectDef.Zero(); + } + } + +