277 |
277 |
278 if( !iPropDefs ) |
278 if( !iPropDefs ) |
279 { |
279 { |
280 CMdEObjectDef& objectDef = mdeObject.Def(); |
280 CMdEObjectDef& objectDef = mdeObject.Def(); |
281 iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef ); |
281 iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef ); |
|
282 // Prefetch max text lengt for validity checking |
|
283 iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL(); |
282 } |
284 } |
283 |
285 |
284 CMdeObjectWrapper::HandleObjectPropertyL( |
286 CMdeObjectWrapper::HandleObjectPropertyL( |
285 mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd ); |
287 mdeObject, *iPropDefs->iCreationDatePropertyDef, &localModifiedDate, aIsAdd ); |
286 |
288 |
310 { |
312 { |
311 if( !iPropDefs ) |
313 if( !iPropDefs ) |
312 { |
314 { |
313 CMdEObjectDef& objectDef = mdeObject.Def(); |
315 CMdEObjectDef& objectDef = mdeObject.Def(); |
314 iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef ); |
316 iPropDefs = CHarvesterAudioPluginPropertyDefs::NewL( objectDef ); |
|
317 // Prefetch max text lengt for validity checking |
|
318 iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL(); |
315 } |
319 } |
316 |
320 |
317 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
321 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
318 *iPropDefs->iItemTypePropertyDef, (TAny*)&(mapping->iMimeType), aIsAdd ); |
322 *iPropDefs->iItemTypePropertyDef, (TAny*)&(mapping->iMimeType), aIsAdd ); |
319 } |
323 } |
391 TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset(); |
397 TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset(); |
392 TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60; |
398 TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60; |
393 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd ); |
399 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd ); |
394 |
400 |
395 if ( song.Length() > 0 |
401 if ( song.Length() > 0 |
396 && song.Length() < iPropDefs->iTitlePropertyDef->MaxTextLengthL() ) |
402 && song.Length() < iMaxTextLength ) |
397 { |
403 { |
398 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
404 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
399 *iPropDefs->iTitlePropertyDef, &song, EFalse ); |
405 *iPropDefs->iTitlePropertyDef, &song, EFalse ); |
400 } |
406 } |
401 |
407 |
402 if ( artist.Length() > 0 |
408 if ( artist.Length() > 0 |
403 && artist.Length() < iPropDefs->iArtistPropertyDef->MaxTextLengthL() ) |
409 && artist.Length() < iMaxTextLength ) |
404 { |
410 { |
405 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
411 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
406 *iPropDefs->iArtistPropertyDef, &artist, aIsAdd ); |
412 *iPropDefs->iArtistPropertyDef, &artist, aIsAdd ); |
407 } |
413 } |
408 |
414 |
409 if ( album.Length() > 0 |
415 if ( album.Length() > 0 |
410 && album.Length() < iPropDefs->iAlbumPropertyDef->MaxTextLengthL() ) |
416 && album.Length() < iMaxTextLength ) |
411 { |
417 { |
412 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
418 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
413 *iPropDefs->iAlbumPropertyDef, &album, aIsAdd ); |
419 *iPropDefs->iAlbumPropertyDef, &album, aIsAdd ); |
414 } |
420 } |
415 |
421 |
416 if ( genre.Length() > 0 |
422 if ( genre.Length() > 0 |
417 && genre.Length() < iPropDefs->iGenrePropertyDef->MaxTextLengthL() ) |
423 && genre.Length() < iMaxTextLength ) |
418 { |
424 { |
419 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
425 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
420 *iPropDefs->iGenrePropertyDef, &genre, aIsAdd ); |
426 *iPropDefs->iGenrePropertyDef, &genre, aIsAdd ); |
421 } |
427 } |
422 |
428 |
423 if ( composer.Length() > 0 |
429 if ( composer.Length() > 0 |
424 && composer.Length() < iPropDefs->iComposerPropertyDef->MaxTextLengthL() ) |
430 && composer.Length() < iMaxTextLength ) |
425 { |
431 { |
426 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
432 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
427 *iPropDefs->iComposerPropertyDef, &composer, aIsAdd ); |
433 *iPropDefs->iComposerPropertyDef, &composer, aIsAdd ); |
428 } |
434 } |
429 |
435 |
438 *iPropDefs->iRatingPropertyDef, &ratingValue, aIsAdd ); |
444 *iPropDefs->iRatingPropertyDef, &ratingValue, aIsAdd ); |
439 } |
445 } |
440 } |
446 } |
441 |
447 |
442 if ( orgArtist.Length() > 0 |
448 if ( orgArtist.Length() > 0 |
443 && orgArtist.Length() < iPropDefs->iOriginalArtistPropertyDef->MaxTextLengthL() ) |
449 && orgArtist.Length() < iMaxTextLength ) |
444 { |
450 { |
445 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
451 CMdeObjectWrapper::HandleObjectPropertyL( mdeObject, |
446 *iPropDefs->iOriginalArtistPropertyDef, &orgArtist, aIsAdd ); |
452 *iPropDefs->iOriginalArtistPropertyDef, &orgArtist, aIsAdd ); |
447 } |
453 } |
448 |
454 |