diff -r 8e4539ab1889 -r c461c7fa72c2 harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp --- a/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Fri May 14 16:17:23 2010 +0300 +++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Thu May 27 13:18:43 2010 +0300 @@ -20,12 +20,14 @@ #include #include #include +#include #include "harvesterlog.h" #include "mdsutils.h" #include "harvesterexifutil.h" #include "harvesterimageplugin.h" #include "mdeobjectwrapper.h" +#include "mdscommoninternal.h" using namespace MdeConstants; @@ -82,6 +84,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty ); iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder ); // Media property definitions CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject ); @@ -191,6 +194,9 @@ delete iPropDefs; + delete iPhoneImagesPath; + delete iMmcImagesPath; + iMimeTypeMappings.Close(); iFbs.Disconnect(); } @@ -255,7 +261,16 @@ User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping( KExtOtb(), KOtbMime(), EOtherHandling ), cmp ) ); + + TFileName images = PathInfo::ImagesPath(); + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( images ); + iPhoneImagesPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( images ); + iMmcImagesPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); } void CHarvesterImagePlugin::HarvestL( CHarvesterData* aHD ) @@ -711,8 +726,22 @@ // Item Type CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aFileData.iMime16, aIsAdd ); + + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcImagesPath->Des()) != KErrNotFound || + uri.FindF( iPhoneImagesPath->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 ); + } } - + if( aFileData.iJpeg ) { // Time offset