57 |
57 |
58 CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); |
58 CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); |
59 iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); |
59 iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); |
60 iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDescriptionProperty ); |
60 iDescriptionPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDescriptionProperty ); |
61 iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KAuthorProperty ); |
61 iAuthorPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KAuthorProperty ); |
|
62 iGenrePropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty ); |
62 } |
63 } |
63 |
64 |
64 CHarvesterOmaDrmPluginPropertyDefs* CHarvesterOmaDrmPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef) |
65 CHarvesterOmaDrmPluginPropertyDefs* CHarvesterOmaDrmPluginPropertyDefs::NewL(CMdEObjectDef& aObjectDef) |
65 { |
66 { |
66 CHarvesterOmaDrmPluginPropertyDefs* self = |
67 CHarvesterOmaDrmPluginPropertyDefs* self = |
167 |
168 |
168 aVHD.iModified = entry->iModified; |
169 aVHD.iModified = entry->iModified; |
169 aVHD.iFileSize = (TUint)entry->iSize; |
170 aVHD.iFileSize = (TUint)entry->iSize; |
170 CleanupStack::PopAndDestroy( entry ); |
171 CleanupStack::PopAndDestroy( entry ); |
171 |
172 |
172 ContentAccess::CContent* content = NULL; |
173 ContentAccess::CContent* content = ContentAccess::CContent::NewLC( uri ); |
173 content = ContentAccess::CContent::NewLC( uri ); |
174 ContentAccess::CData* data = content->OpenContentLC( ContentAccess::EPeek ); |
174 |
175 |
175 ContentAccess::RStringAttributeSet attrSet; |
176 ContentAccess::RStringAttributeSet attrSet; |
176 CleanupClosePushL( attrSet ); |
177 CleanupClosePushL( attrSet ); |
177 |
178 |
178 attrSet.AddL( ContentAccess::EDescription ); |
179 attrSet.AddL( ContentAccess::EDescription ); |
179 attrSet.AddL( ContentAccess::EMimeType ); |
180 attrSet.AddL( ContentAccess::EMimeType ); |
180 attrSet.AddL( ContentAccess::ETitle ); |
181 attrSet.AddL( ContentAccess::ETitle ); |
181 attrSet.AddL( ContentAccess::EAuthor ); |
182 attrSet.AddL( ContentAccess::EAuthor ); |
182 |
183 attrSet.AddL( ContentAccess::EGenre ); |
183 User::LeaveIfError( content->GetStringAttributeSet(attrSet) ); |
184 |
|
185 User::LeaveIfError( data->GetStringAttributeSet(attrSet) ); |
184 |
186 |
185 TInt err = attrSet.GetValue( ContentAccess::EDescription, aVHD.iDescription ); |
187 TInt err = attrSet.GetValue( ContentAccess::EDescription, aVHD.iDescription ); |
186 if ( err != KErrNone) |
188 if ( err != KErrNone) |
187 { |
189 { |
188 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting description failed %d", err ); |
190 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting description failed %d", err ); |
223 |
225 |
224 if ( aVHD.iAuthor.Length() <= 0 ) |
226 if ( aVHD.iAuthor.Length() <= 0 ) |
225 { |
227 { |
226 WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no author" ); |
228 WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no author" ); |
227 } |
229 } |
|
230 |
|
231 err = attrSet.GetValue( ContentAccess::EGenre, aVHD.iGenre ); |
|
232 if ( err != KErrNone) |
|
233 { |
|
234 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting genre failed %d", err ); |
|
235 } |
|
236 |
|
237 if ( aVHD.iGenre.Length() <= 0 ) |
|
238 { |
|
239 WRITELOG( "CHarvesterOMADRMPlugin::GatherDataL - no genre" ); |
|
240 } |
228 |
241 |
229 err = content->GetAttribute( ContentAccess::EIsProtected, aVHD.iDrmProtected ); |
242 err = content->GetAttribute( ContentAccess::EIsProtected, aVHD.iDrmProtected ); |
230 if ( err != KErrNone) |
243 if ( err != KErrNone) |
231 { |
244 { |
232 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err ); |
245 WRITELOG1( "CHarvesterOMADRMPlugin::GatherDataL - ERROR: getting protection info failed %d", err ); |
233 } |
246 } |
234 |
247 |
235 CleanupStack::PopAndDestroy( 2, content ); |
248 CleanupStack::PopAndDestroy( 3 ); // content, data, attrSet |
236 } |
249 } |
237 |
250 |
238 // --------------------------------------------------------------------------- |
251 // --------------------------------------------------------------------------- |
239 // HandleNewObjectL |
252 // HandleNewObjectL |
240 // --------------------------------------------------------------------------- |
253 // --------------------------------------------------------------------------- |
303 if(aVHD.iAuthor.Length() > 0) |
316 if(aVHD.iAuthor.Length() > 0) |
304 { |
317 { |
305 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
318 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
306 *iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd ); |
319 *iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd ); |
307 } |
320 } |
|
321 // Genre |
|
322 if(aVHD.iGenre.Length() > 0) |
|
323 { |
|
324 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, |
|
325 *iPropDefs->iGenrePropertyDef, &aVHD.iGenre, aIsAdd ); |
|
326 } |
308 } |
327 } |
309 |
328 |
310 // --------------------------------------------------------------------------- |
329 // --------------------------------------------------------------------------- |
311 // ChangeObjectType |
330 // ChangeObjectType |
312 // --------------------------------------------------------------------------- |
331 // --------------------------------------------------------------------------- |