equal
deleted
inserted
replaced
25 #include <e32hashtab.h> |
25 #include <e32hashtab.h> |
26 #include "OpmlParser.h" |
26 #include "OpmlParser.h" |
27 #include "PodcastUtils.h" |
27 #include "PodcastUtils.h" |
28 #include <utf.h> |
28 #include <utf.h> |
29 |
29 |
|
30 _LIT(KFeedParseStorePath, "feeds\\"); |
30 // Cleanup stack macro for SQLite3 |
31 // Cleanup stack macro for SQLite3 |
31 // TODO Move this to some common place. |
32 // TODO Move this to some common place. |
32 static void Cleanup_sqlite3_finalize_wrapper(TAny* handle) |
33 static void Cleanup_sqlite3_finalize_wrapper(TAny* handle) |
33 { |
34 { |
34 sqlite3_finalize(static_cast<sqlite3_stmt*>(handle)); |
35 sqlite3_finalize(static_cast<sqlite3_stmt*>(handle)); |
64 TFileName defaultFile = iPodcastModel.SettingsEngine().DefaultFeedsFileName(); |
65 TFileName defaultFile = iPodcastModel.SettingsEngine().DefaultFeedsFileName(); |
65 DP1("Loading default feeds from %S", &defaultFile); |
66 DP1("Loading default feeds from %S", &defaultFile); |
66 if (BaflUtils::FileExists(iPodcastModel.FsSession(), defaultFile)) { |
67 if (BaflUtils::FileExists(iPodcastModel.FsSession(), defaultFile)) { |
67 ImportFeedsL(defaultFile); |
68 ImportFeedsL(defaultFile); |
68 } |
69 } |
|
70 } else { |
|
71 // clean out feeds temp directory |
|
72 TFileName feedTempPath; |
|
73 feedTempPath.Copy (iPodcastModel.SettingsEngine().PrivatePath ()); |
|
74 feedTempPath.Append(KFeedParseStorePath); |
|
75 feedTempPath.Append(_L("*")); |
|
76 |
|
77 BaflUtils::EnsurePathExistsL(iPodcastModel.FsSession(), feedTempPath); |
|
78 BaflUtils::DeleteFile(iPodcastModel.FsSession(),feedTempPath); |
69 } |
79 } |
70 |
80 |
71 TFileName importFile = iPodcastModel.SettingsEngine().ImportFeedsFileName(); |
81 TFileName importFile = iPodcastModel.SettingsEngine().ImportFeedsFileName(); |
72 if (BaflUtils::FileExists(iPodcastModel.FsSession(), importFile)) { |
82 if (BaflUtils::FileExists(iPodcastModel.FsSession(), importFile)) { |
73 DP("Importing feeds"); |
83 DP("Importing feeds"); |
227 |
237 |
228 iActiveFeed->SetLastError(KErrNone); |
238 iActiveFeed->SetLastError(KErrNone); |
229 DBUpdateFeedL(*iActiveFeed); |
239 DBUpdateFeedL(*iActiveFeed); |
230 |
240 |
231 iUpdatingFeedFileName.Copy (iPodcastModel.SettingsEngine().PrivatePath ()); |
241 iUpdatingFeedFileName.Copy (iPodcastModel.SettingsEngine().PrivatePath ()); |
|
242 iUpdatingFeedFileName.Append(KFeedParseStorePath); |
|
243 BaflUtils::EnsurePathExistsL(iPodcastModel.FsSession(), iUpdatingFeedFileName); |
|
244 |
232 _LIT(KFileNameFormat, "%lu.xml"); |
245 _LIT(KFileNameFormat, "%lu.xml"); |
233 iUpdatingFeedFileName.AppendFormat(KFileNameFormat, aFeedUid); |
246 iUpdatingFeedFileName.AppendFormat(KFileNameFormat, aFeedUid); |
234 |
247 |
235 if(iFeedClient->GetL(iActiveFeed->Url(), iUpdatingFeedFileName, iPodcastModel.SettingsEngine().SpecificIAP())) |
248 if(iFeedClient->GetL(iActiveFeed->Url(), iUpdatingFeedFileName, iPodcastModel.SettingsEngine().SpecificIAP())) |
236 { |
249 { |