engine/src/FeedInfo.cpp
changeset 60 bbf5c5204844
parent 59 dc142c8740eb
child 64 b52f6033af15
equal deleted inserted replaced
59:dc142c8740eb 60:bbf5c5204844
    15 * Description:
    15 * Description:
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 #include "FeedInfo.h"
    19 #include "FeedInfo.h"
       
    20 #include "FeedEngine.h"
       
    21 #include "PodcastModel.h"
    20 #include <e32hashtab.h>
    22 #include <e32hashtab.h>
    21 #include <fbs.h>
    23 #include <fbs.h>
    22 #include <bautils.h>
    24 #include <bautils.h>
    23 #include <eikenv.h>
    25 #include <eikenv.h>
    24 _LIT(KMbmExtension, ".mbm");
    26 _LIT(KMbmExtension, ".mbm");
   207 	cacheFileName.Append(KMbmExtension());
   209 	cacheFileName.Append(KMbmExtension());
   208 	if( iFeedIcon->SizeInPixels() == TSize(0,0) && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
   210 	if( iFeedIcon->SizeInPixels() == TSize(0,0) && BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
   209 		{
   211 		{
   210 		iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0);
   212 		iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0);
   211 		}	
   213 		}	
   212 	}
   214 	} 
   213 
   215 
   214 EXPORT_C TBool CFeedInfo::CustomTitle() const
   216 EXPORT_C TBool CFeedInfo::CustomTitle() const
   215 	{
   217 	{
   216 	return iCustomTitle;
   218 	return iCustomTitle;
   217 	}
   219 	}
   239 EXPORT_C void CFeedInfo::SetFeedIcon(CFbsBitmap* aBitmapToClone)
   241 EXPORT_C void CFeedInfo::SetFeedIcon(CFbsBitmap* aBitmapToClone)
   240 	{
   242 	{
   241 	iFeedIcon->Duplicate(aBitmapToClone->Handle());
   243 	iFeedIcon->Duplicate(aBitmapToClone->Handle());
   242 	}
   244 	}
   243 
   245 
   244 void CFeedInfo::ImageOperationCompleteL(TInt aError, TUint /*aHandle*/)
   246 void CFeedInfo::ImageOperationCompleteL(TInt aError, TUint /*aHandle*/, CPodcastModel& aPodcastModel)
   245 	{
   247 	{		
   246 		
       
   247 	if (aError == KErrNone && iImageFileName && iFeedIcon)
   248 	if (aError == KErrNone && iImageFileName && iFeedIcon)
   248 		{
   249 		{
   249 		TFileName cacheFileName;
   250 		TFileName cacheFileName;
   250 	
   251 	
   251 		TParsePtrC parser(*iImageFileName);
   252 		TParsePtrC parser(*iImageFileName);
   252 		cacheFileName = parser.DriveAndPath();
   253 		cacheFileName = parser.DriveAndPath();
   253 		cacheFileName.Append(parser.Name());
   254 		cacheFileName.Append(parser.Name());
   254 		cacheFileName.Append(KMbmExtension());		
   255 		cacheFileName.Append(KMbmExtension());		
   255 		iFeedIcon->Save(cacheFileName);					
   256 		iFeedIcon->Save(cacheFileName);					
   256 		}
   257 		aPodcastModel.FeedEngine().NotifyFeedUpdateComplete(this->iUid, KErrNone);
   257 	}
   258 		}
       
   259 	}