engine/src/FeedInfo.cpp
changeset 109 223f270fa7ff
parent 106 83752b9e3cb6
child 228 c553fa9dcbe5
child 311 606f4f6babf6
--- a/engine/src/FeedInfo.cpp	Sun Apr 04 00:21:57 2010 +0100
+++ b/engine/src/FeedInfo.cpp	Sun Apr 04 15:54:17 2010 +0100
@@ -52,7 +52,9 @@
 	copy->SetLinkL(Link());
 	copy->SetBuildDate(BuildDate());
 	copy->SetLastUpdated(LastUpdated());
-	copy->iFeedIcon->Duplicate(iFeedIcon->Handle());
+	if (iFeedIcon) {
+		copy->SetFeedIcon(iFeedIcon);
+	}
 	copy->SetImageFileNameL(ImageFileName(), NULL);
 	if(CustomTitle())
 		{
@@ -64,6 +66,7 @@
 	CleanupStack::Pop(copy);
 	return copy;
 	}
+
 CFeedInfo::CFeedInfo()
 	{
 	iCustomTitle = EFalse;
@@ -82,7 +85,7 @@
 
 void CFeedInfo::ConstructL()
 	{
-	iFeedIcon = new (ELeave) CFbsBitmap;
+	//iFeedIcon = new (ELeave) CFbsBitmap;
 	}
 
 EXPORT_C const TDesC& CFeedInfo::Url() const
@@ -195,6 +198,7 @@
 
 EXPORT_C void CFeedInfo::SetImageFileNameL(const TDesC& aFileName, CPodcastModel* aPodcastModel)
 	{
+	DP1("CFeedInfo::SetImageFileNameL BEGIN, aFileName=%S", &aFileName);
 	TFileName cacheFileName;
 	
 	if (iImageFileName)
@@ -209,15 +213,21 @@
 	cacheFileName.Append(parser.Name());
 	cacheFileName.Append(KMbmExtension());
 	
-	if( iFeedIcon->SizeInPixels() == TSize(0,0) && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
+	if (iFeedIcon) {
+		delete iFeedIcon;
+	}
+	
+	if( BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
 		{
 		iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0);
 		}
 	else if(aPodcastModel &&  BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), ImageFileName() ))
 		{
 		// If this fails, no reason to worry
+		iFeedIcon = new CFbsBitmap();
 		TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(64,56), *this, Uid()));
-		}		
+		}	
+	DP("CFeedInfo::SetImageFileNameL END");
 	} 
 
 EXPORT_C TBool CFeedInfo::CustomTitle() const