diff -r 33ae025ac1e8 -r 2290317b9ec5 harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp --- a/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Mon May 03 12:55:01 2010 +0300 +++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Fri May 14 16:38:28 2010 +0300 @@ -17,12 +17,14 @@ #include #include +#include #include "mdsutils.h" #include "harvesterdata.h" #include "harvesterlog.h" #include "harvestercommon.h" #include "harvesterwmvplugin.h" +#include "mdscommoninternal.h" #include #include #include "mdeobject.h" @@ -44,6 +46,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); @@ -86,6 +89,9 @@ { WRITELOG( "CHarvesterWMVPlugin::~CHarvesterWMVPlugin()" ); delete iPropDefs; + + delete iPhoneVideosPath; + delete iMmcVideosPath; } // --------------------------------------------------------------------------- @@ -163,6 +169,17 @@ void CHarvesterWMVPlugin::ConstructL() { WRITELOG( "CHarvesterWMVPlugin::ConstructL()" ); + + TFileName videos = PathInfo::VideosPath(); + + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( videos ); + iPhoneVideosPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( videos ); + iMmcVideosPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); + SetPriority( KHarvesterPriorityHarvestingPlugin - 1 ); } @@ -301,6 +318,20 @@ // Mime Type CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd ); + + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound || + uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } } // DRM protection @@ -310,7 +341,7 @@ *iPropDefs->iDrmPropertyDef, &aClipDetails.iDrmProtected, aIsAdd ); } // Title (is set from URI by default) - if( aClipDetails.iTitle.Length() > 0 && aClipDetails.iTitle.Length() < iMaxTextLength ) + if( aClipDetails.iTitle.Length() > 0 && aClipDetails.iTitle.Length() < KMaxTitleFieldLength ) { CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTitlePropertyDef, &aClipDetails.iTitle, EFalse );