mmappcomponents/harvester/collectionmediator/src/mpxcollectionmediator.cpp
branchRCL_3
changeset 15 d240f0a77280
parent 0 a2952bb97e68
equal deleted inserted replaced
14:05b0d2323768 15:d240f0a77280
   224     // put mediaId in aMedia
   224     // put mediaId in aMedia
   225     aMedia->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, mediaId);
   225     aMedia->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, mediaId);
   226     }
   226     }
   227 
   227 
   228 // ---------------------------------------------------------------------------
   228 // ---------------------------------------------------------------------------
       
   229 // CMPXCollectionMediator::AddItemAsyncL()
       
   230 // ---------------------------------------------------------------------------
       
   231 //
       
   232 EXPORT_C void CMPXCollectionMediator::AddItemAsyncL( CMPXMedia*& aMedia )
       
   233     {
       
   234     ASSERT( iColUtil );
       
   235 
       
   236     // If this is a podcast, change the collection id
       
   237     if( IsPodcastL( *aMedia ) )
       
   238         {
       
   239         UpdatePathToPodcastL( *aMedia );
       
   240         }
       
   241 
       
   242     // Add it to the collection
       
   243     CMPXCommand* cmd = CMPXMedia::NewL();
       
   244     CleanupStack::PushL( cmd );
       
   245 
       
   246     cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionAdd );
       
   247     cmd->SetCObjectValueL(KMPXCommandColAddMedia, aMedia); // copied
       
   248 
       
   249     if (aMedia->IsSupported(KMPXMediaGeneralCollectionId))
       
   250         {
       
   251         TUid collectionId = aMedia->ValueTObjectL<TUid>(KMPXMediaGeneralCollectionId);
       
   252         cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, collectionId.iUid);
       
   253         }
       
   254     else
       
   255         {
       
   256         User::Leave( KErrArgument );
       
   257         }
       
   258 
       
   259     iColUtil->CommandL(*cmd);
       
   260 
       
   261     CleanupStack::PopAndDestroy(cmd);
       
   262     }
       
   263 
       
   264 // ---------------------------------------------------------------------------
   229 // CMPXCollectionMediator::AddItemL()
   265 // CMPXCollectionMediator::AddItemL()
   230 // ---------------------------------------------------------------------------
   266 // ---------------------------------------------------------------------------
   231 //
   267 //
   232 EXPORT_C void CMPXCollectionMediator::AddItemL( CMPXMediaArray& aMPArray )
   268 EXPORT_C void CMPXCollectionMediator::AddItemL( CMPXMediaArray& aMPArray )
   233     {
   269     {