# HG changeset patch # User jakl.martin@cell-telecom.com # Date 1279539966 -7200 # Node ID 45e21fd808cd2e4e64d3a5edb775d0da2690d749 # Parent 92eadaba67e64f737990263612cf77ccb3b448f6 Fix for bug 2716 diff -r 92eadaba67e6 -r 45e21fd808cd engine/group/engine.mmp --- a/engine/group/engine.mmp Thu Jul 15 21:29:09 2010 +0100 +++ b/engine/group/engine.mmp Mon Jul 19 13:46:06 2010 +0200 @@ -72,5 +72,6 @@ LIBRARY commonui.lib // CDocumentHandler LIBRARY apparc.lib LIBRARY avkon.lib +LIBRARY centralrepository.lib CAPABILITY All -TCB diff -r 92eadaba67e6 -r 45e21fd808cd engine/inc/FeedEngine.h --- a/engine/inc/FeedEngine.h Thu Jul 15 21:29:09 2010 +0100 +++ b/engine/inc/FeedEngine.h Mon Jul 19 13:46:06 2010 +0200 @@ -54,6 +54,7 @@ ESearching }; + class CFeedEngine : public CBase, public MHttpClientObserver, public MFeedParserObserver { public: @@ -95,6 +96,7 @@ IMPORT_C void OpmlParsingCompleteL(TInt aError, TUint aNumFeedsAdded); void NotifyFeedUpdateComplete(TInt aFeedUid, TInt aError); + protected: static TInt CompareFeedsByTitle(const CFeedInfo &a, const CFeedInfo &b); @@ -155,6 +157,9 @@ TBool newFeed; TUint showsAdded; + // offline mode detection + CRepository* iRepository; + sqlite3& iDB; TBuf iSqlBuffer; diff -r 92eadaba67e6 -r 45e21fd808cd engine/src/FeedEngine.cpp --- a/engine/src/FeedEngine.cpp Thu Jul 15 21:29:09 2010 +0100 +++ b/engine/src/FeedEngine.cpp Mon Jul 19 13:46:06 2010 +0200 @@ -27,9 +27,13 @@ #include "PodcastUtils.h" #include #include "Podcatcher.pan" +#include +#include + _LIT(KFeedParseStorePath, "feeds\\"); + CFeedEngine* CFeedEngine::NewL(CPodcastModel& aPodcastModel) { CFeedEngine* self = new (ELeave) CFeedEngine(aPodcastModel); @@ -80,6 +84,10 @@ TRAP_IGNORE(ImportFeedsL(importFile)); } + + // offline profile support + iRepository = CRepository::NewL( KCRUidProfileEngine ); + RunFeedTimer(); } @@ -102,6 +110,8 @@ delete iParser; delete iFeedClient; delete iOpmlParser; + // + delete iRepository; } /** @@ -148,9 +158,22 @@ { User::Leave(KErrInUse); } - + // check for offline profile, done by polling here, perhpas CenRep notifier woudl be better + TInt currentProfileId = 0; // general profile + TBool isOfflineProfile = EFalse; + // Get ID of current profile + if(KErrNone == iRepository->Get( KProEngActiveProfile, currentProfileId ) ) // better to assume online then leave if CRep fails + { + // Check value to determine the active profile if no error + if ( 5 == currentProfileId) + { + // current profile is the offline profile + isOfflineProfile = ETrue; + } + } + // iAutoUpdatedInitiator = aAutoUpdate; - if (iFeedsUpdating.Count() > 0) + if ((iFeedsUpdating.Count() > 0) || (isOfflineProfile)) // cancel update if in offline mode { DP("Cancelling update"); iFeedClient->Stop();