--- a/mmappcomponents/harvester/collectionmediator/src/mpxcollectionmediator.cpp Fri Mar 12 15:44:36 2010 +0200
+++ b/mmappcomponents/harvester/collectionmediator/src/mpxcollectionmediator.cpp Mon Mar 15 12:42:31 2010 +0200
@@ -226,6 +226,42 @@
}
// ---------------------------------------------------------------------------
+// CMPXCollectionMediator::AddItemAsyncL()
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CMPXCollectionMediator::AddItemAsyncL( CMPXMedia*& aMedia )
+ {
+ ASSERT( iColUtil );
+
+ // If this is a podcast, change the collection id
+ if( IsPodcastL( *aMedia ) )
+ {
+ UpdatePathToPodcastL( *aMedia );
+ }
+
+ // Add it to the collection
+ CMPXCommand* cmd = CMPXMedia::NewL();
+ CleanupStack::PushL( cmd );
+
+ cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionAdd );
+ cmd->SetCObjectValueL(KMPXCommandColAddMedia, aMedia); // copied
+
+ if (aMedia->IsSupported(KMPXMediaGeneralCollectionId))
+ {
+ TUid collectionId = aMedia->ValueTObjectL<TUid>(KMPXMediaGeneralCollectionId);
+ cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, collectionId.iUid);
+ }
+ else
+ {
+ User::Leave( KErrArgument );
+ }
+
+ iColUtil->CommandL(*cmd);
+
+ CleanupStack::PopAndDestroy(cmd);
+ }
+
+// ---------------------------------------------------------------------------
// CMPXCollectionMediator::AddItemL()
// ---------------------------------------------------------------------------
//