# HG changeset patch # User teknolog # Date 1272899390 -3600 # Node ID c70a6524a23645d5ec0a9b1207991c10bde5d33a # Parent 46e6a623d36d0806dd7b48d14440cb5d8869ccb2 Basic MPX integration done - Podcatcher can now add files to MPXCollection, but not remove or update diff -r 46e6a623d36d -r c70a6524a236 engine/group/engine.mmp --- a/engine/group/engine.mmp Mon May 03 15:23:15 2010 +0100 +++ b/engine/group/engine.mmp Mon May 03 16:09:50 2010 +0100 @@ -67,5 +67,6 @@ LIBRARY imageconversion.lib LIBRARY bitmaptransforms.lib LIBRARY eikcore.lib +LIBRARY mpxcollectionhelper.lib CAPABILITY NetworkServices UserEnvironment diff -r 46e6a623d36d -r c70a6524a236 engine/inc/ShowEngine.h --- a/engine/inc/ShowEngine.h Mon May 03 15:23:15 2010 +0100 +++ b/engine/inc/ShowEngine.h Mon May 03 16:09:50 2010 +0100 @@ -28,8 +28,11 @@ #include "ShowEngineObserver.h" #include "MetaDataReader.h" #include +#include "mpxcollectionhelper.h" +#include "mpxcollectionhelperobserver.h" -class CShowEngine : public CBase, public MHttpClientObserver, public MMetaDataReaderObserver +class CShowEngine : public CBase, public MHttpClientObserver, public MMetaDataReaderObserver, + public MMPXCollectionHelperObserver { public: IMPORT_C static CShowEngine* NewL(CPodcastModel& aPodcastModel); @@ -84,7 +87,9 @@ // from MetaDataReaderObserver void ReadMetaDataL(CShowInfo& aShowInfo); void ReadMetaDataCompleteL(); - + // from MMPXCollectionHelperObserver + void HandleAddFileCompleteL( TInt aErr ) {} + private: CShowEngine(CPodcastModel& aPodcastModel); void ConstructL(); @@ -142,6 +147,8 @@ sqlite3& iDB; TBuf iSqlBuffer; + + MMPXCollectionHelper* iCollectionHelper; }; #endif /*SHOWENGINE_H_*/ diff -r 46e6a623d36d -r c70a6524a236 engine/src/ShowEngine.cpp --- a/engine/src/ShowEngine.cpp Mon May 03 15:23:15 2010 +0100 +++ b/engine/src/ShowEngine.cpp Mon May 03 16:09:50 2010 +0100 @@ -26,10 +26,7 @@ #include #include "debug.h" #include "PodcastUtils.h" - -//#include -//#include -//#include +#include const TUint KMaxDownloadErrors = 3; const TInt KMimeBufLength = 100; @@ -47,6 +44,9 @@ delete iShowDownloading; delete iMetaDataReader; iApaSession.Close(); + + if (iCollectionHelper) + delete iCollectionHelper; } EXPORT_C CShowEngine* CShowEngine::NewL(CPodcastModel& aPodcastModel) @@ -239,15 +239,14 @@ } } -void CShowEngine::AddShowToMpxCollection(CShowInfo &/*aShowInfo*/) +void CShowEngine::AddShowToMpxCollection(CShowInfo &aShowInfo) { -/* RArray contentIDs; - contentIDs.AppendL( KMPXMediaIdGeneral ); + if (!iCollectionHelper) + iCollectionHelper = CMPXCollectionHelperFactory::NewCollectionHelperL(); - CMPXMedia* media = CMPXMedia::NewL( contentIDs.Array() ); - CleanupStack::PushL( media ); - contentIDs.Close(); - CleanupStack::PopAndDestroy(media); */ + // if this leaves, not much we can do anyway + TRAP_IGNORE(iCollectionHelper->AddL(aShowInfo.FileName(), this)); + } void CShowEngine::CompleteL(CHttpClient* /*aHttpClient*/, TInt aError)