51 copy->SetImageUrlL(ImageUrl()); |
51 copy->SetImageUrlL(ImageUrl()); |
52 copy->SetLinkL(Link()); |
52 copy->SetLinkL(Link()); |
53 copy->SetBuildDate(BuildDate()); |
53 copy->SetBuildDate(BuildDate()); |
54 copy->SetLastUpdated(LastUpdated()); |
54 copy->SetLastUpdated(LastUpdated()); |
55 copy->iFeedIcon->Duplicate(iFeedIcon->Handle()); |
55 copy->iFeedIcon->Duplicate(iFeedIcon->Handle()); |
56 copy->SetImageFileNameL(ImageFileName()); |
56 copy->SetImageFileNameL(ImageFileName(), NULL); |
57 if(CustomTitle()) |
57 if(CustomTitle()) |
58 { |
58 { |
59 copy->SetCustomTitle(); |
59 copy->SetCustomTitle(); |
60 } |
60 } |
61 |
61 |
191 EXPORT_C const TDesC& CFeedInfo::ImageFileName() const |
191 EXPORT_C const TDesC& CFeedInfo::ImageFileName() const |
192 { |
192 { |
193 return iImageFileName ? *iImageFileName : KNullDesC(); |
193 return iImageFileName ? *iImageFileName : KNullDesC(); |
194 } |
194 } |
195 |
195 |
196 EXPORT_C void CFeedInfo::SetImageFileNameL(const TDesC& aFileName) |
196 EXPORT_C void CFeedInfo::SetImageFileNameL(const TDesC& aFileName, CPodcastModel* aPodcastModel) |
197 { |
197 { |
198 TFileName cacheFileName; |
198 TFileName cacheFileName; |
199 |
199 |
200 if (iImageFileName) |
200 if (iImageFileName) |
201 { |
201 { |
202 delete iImageFileName; |
202 delete iImageFileName; |
203 iImageFileName = NULL; |
203 iImageFileName = NULL; |
204 } |
204 } |
|
205 |
205 iImageFileName = aFileName.AllocL(); |
206 iImageFileName = aFileName.AllocL(); |
206 TParsePtrC parser(*iImageFileName); |
207 TParsePtrC parser(*iImageFileName); |
207 cacheFileName = parser.DriveAndPath(); |
208 cacheFileName = parser.DriveAndPath(); |
208 cacheFileName.Append(parser.Name()); |
209 cacheFileName.Append(parser.Name()); |
209 cacheFileName.Append(KMbmExtension()); |
210 cacheFileName.Append(KMbmExtension()); |
|
211 |
210 if( iFeedIcon->SizeInPixels() == TSize(0,0) && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) ) |
212 if( iFeedIcon->SizeInPixels() == TSize(0,0) && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) ) |
211 { |
213 { |
212 iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0); |
214 iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0); |
213 } |
215 } |
|
216 else if(aPodcastModel && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), ImageFileName() )) |
|
217 { |
|
218 // If this fails, no reason to worry |
|
219 TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(64,56), *this, Uid())); |
|
220 } |
214 } |
221 } |
215 |
222 |
216 EXPORT_C TBool CFeedInfo::CustomTitle() const |
223 EXPORT_C TBool CFeedInfo::CustomTitle() const |
217 { |
224 { |
218 return iCustomTitle; |
225 return iCustomTitle; |