260 |
260 |
261 if( !iPropDefs ) |
261 if( !iPropDefs ) |
262 { |
262 { |
263 CMdEObjectDef& objectDef = mdeObject.Def(); |
263 CMdEObjectDef& objectDef = mdeObject.Def(); |
264 iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL( objectDef ); |
264 iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL( objectDef ); |
|
265 // Prefetch max text lengt for validity checking |
|
266 iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL(); |
265 } |
267 } |
266 |
268 |
267 TTimeIntervalSeconds timeOffset = User::UTCOffset(); |
269 TTimeIntervalSeconds timeOffset = User::UTCOffset(); |
268 |
270 |
269 if( ! mdeObject.Placeholder() ) |
271 if( ! mdeObject.Placeholder() ) |
297 // DRM protection |
299 // DRM protection |
298 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
300 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
299 *iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd ); |
301 *iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd ); |
300 |
302 |
301 // Title (is set from URI by default) |
303 // Title (is set from URI by default) |
302 if(aVHD.iTitle.Length() > 0) |
304 if( aVHD.iTitle.Length() > 0 && aVHD.iTitle.Length() < iMaxTextLength ) |
303 { |
305 { |
304 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
306 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
305 *iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse ); |
307 *iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse ); |
306 } |
308 } |
307 // Description |
309 // Description |
308 if(aVHD.iDescription.Length() > 0) |
310 if( aVHD.iDescription.Length() > 0 && aVHD.iDescription.Length() < iMaxTextLength ) |
309 { |
311 { |
310 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
312 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
311 *iPropDefs->iDescriptionPropertyDef, &aVHD.iDescription, aIsAdd ); |
313 *iPropDefs->iDescriptionPropertyDef, &aVHD.iDescription, aIsAdd ); |
312 } |
314 } |
313 // Author |
315 // Author |
314 if(aVHD.iAuthor.Length() > 0) |
316 if( aVHD.iAuthor.Length() > 0 && aVHD.iAuthor.Length() < iMaxTextLength ) |
315 { |
317 { |
316 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
318 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
317 *iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd ); |
319 *iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd ); |
318 } |
320 } |
319 // Genre |
321 // Genre |
320 if(aVHD.iGenre.Length() > 0) |
322 if( aVHD.iGenre.Length() > 0 && aVHD.iGenre.Length() < iMaxTextLength ) |
321 { |
323 { |
322 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
324 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
323 *iPropDefs->iGenrePropertyDef, &aVHD.iGenre, aIsAdd ); |
325 *iPropDefs->iGenrePropertyDef, &aVHD.iGenre, aIsAdd ); |
324 } |
326 } |
325 } |
327 } |