harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp
changeset 20 6dfc5f825351
parent 3 b73a2e62868f
child 21 50bf9db68373
--- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Tue Feb 02 00:24:33 2010 +0200
+++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp	Fri Mar 19 09:38:01 2010 +0200
@@ -129,7 +129,6 @@
     CleanupStack::PopAndDestroy( rep );   
 	
 	iAudioParser = CAudioMDParser::NewL( iHarvestAlbumArt );
-    iAudioParser->ResetL();
     
     if( iHarvestAlbumArt )
         {
@@ -168,7 +167,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CHarvesterAudioPlugin::HarvestL (from CHarvesterPlugin)
+// CHarvesterAudioPlugin::ThumbnailReady
 // ---------------------------------------------------------------------------
 //    
 void CHarvesterAudioPlugin::ThumbnailReady( TInt /*aError*/, 
@@ -179,6 +178,25 @@
     }
 
 // ---------------------------------------------------------------------------
+// CHarvesterAudioPlugin::GetMimeType (from CHarvesterPlugin)
+// ---------------------------------------------------------------------------
+//    
+void CHarvesterAudioPlugin::GetMimeType( const TDesC& aUri, TDes& aMimeType )
+    {
+    aMimeType.Zero();
+    
+    const TMimeTypeMapping<TAudioMetadataHandling>* mapping = 
+        iAudioParser->ParseMimeType( aUri );
+
+    if ( !mapping )
+        {
+        return;
+        }
+    
+    aMimeType = mapping->iMimeType;
+    }
+
+// ---------------------------------------------------------------------------
 // CHarvesterAudioPlugin::DoHarvestL
 // ---------------------------------------------------------------------------
 //    
@@ -279,7 +297,7 @@
     const TMimeTypeMapping<TAudioMetadataHandling>* mapping = 
     	iAudioParser->ParseMimeType( mdeObject.Uri() );
     
-    if ( mapping )
+    if ( mapping && !mdeObject.Placeholder() )
         {
     	if( !iPropDefs )
     		{
@@ -343,17 +361,9 @@
     
     if ( song.Length() > 0
         && song.Length() < iPropDefs->iTitlePropertyDef->MaxTextLengthL() )
-        {
-        TRAPD( error, CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
-        		*iPropDefs->iTitlePropertyDef, &song, aIsAdd ) );
-        if( error != KErrNone )
-            {
-            CMdEProperty* prop = NULL;
-            const TInt index = mdeObject.Property( *iPropDefs->iTitlePropertyDef, prop );
-            mdeObject.RemoveProperty( index );
-            CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
-            		*iPropDefs->iTitlePropertyDef, &song, aIsAdd );
-            }
+        {    
+        CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, 
+        		*iPropDefs->iTitlePropertyDef, &song, EFalse );
         }
 
     if ( artist.Length() > 0