equal
deleted
inserted
replaced
22 #include <s32file.h> |
22 #include <s32file.h> |
23 #include <charconv.h> |
23 #include <charconv.h> |
24 #include <xml/stringdictionarycollection.h> |
24 #include <xml/stringdictionarycollection.h> |
25 #include <utf.h> |
25 #include <utf.h> |
26 #include <tinternetdate.h> |
26 #include <tinternetdate.h> |
|
27 #include <e32hashtab.h> |
27 #include "debug.h" |
28 #include "debug.h" |
28 #include "podcastutils.h" |
29 #include "podcastutils.h" |
29 |
30 |
30 using namespace Xml; |
31 using namespace Xml; |
31 const TInt KMaxParseBuffer = 1024; |
32 const TInt KMaxParseBuffer = 1024; |
157 } else { |
158 } else { |
158 iFeedState=EStateChannelImage; |
159 iFeedState=EStateChannelImage; |
159 } |
160 } |
160 break; |
161 break; |
161 case EStateItem: |
162 case EStateItem: |
|
163 iUid = 0; |
162 // <channel> <item> <title> |
164 // <channel> <item> <title> |
163 if (str.CompareF(KTagTitle) == 0) { |
165 if (str.CompareF(KTagTitle) == 0) { |
164 iFeedState=EStateItemTitle; |
166 iFeedState=EStateItemTitle; |
165 // <channel> <item> <link> |
167 // <channel> <item> <link> |
166 } else if (str.CompareF(KTagLink) == 0) { |
168 } else if (str.CompareF(KTagLink) == 0) { |
195 iFeedState=EStateItemDescription; |
197 iFeedState=EStateItemDescription; |
196 // <channel> <item> <pubdate> |
198 // <channel> <item> <pubdate> |
197 } else if (str.CompareF(KTagPubDate) == 0) { |
199 } else if (str.CompareF(KTagPubDate) == 0) { |
198 //DP("LastBuildDate BEGIN"); |
200 //DP("LastBuildDate BEGIN"); |
199 iFeedState = EStateItemPubDate; |
201 iFeedState = EStateItemPubDate; |
|
202 // <channel> <item> <guid> |
|
203 } else if (str.CompareF(KTagGuid) == 0) { |
|
204 iFeedState = EStateItemGuid; |
200 } |
205 } |
201 break; |
206 break; |
202 default: |
207 default: |
203 //DP2("Ignoring tag %S when in state %d", &str, iFeedState); |
208 //DP2("Ignoring tag %S when in state %d", &str, iFeedState); |
204 break; |
209 break; |
271 } |
276 } |
272 break; |
277 break; |
273 case EStateItem: |
278 case EStateItem: |
274 if (str.CompareF(KTagItem) == 0) |
279 if (str.CompareF(KTagItem) == 0) |
275 { |
280 { |
276 |
|
277 // check if we have a valid pubdate |
281 // check if we have a valid pubdate |
278 |
|
279 if (iActiveShow->PubDate().Int64() == 0) |
282 if (iActiveShow->PubDate().Int64() == 0) |
280 { |
283 { |
281 // set pubDate to present time |
284 // set pubDate to present time |
282 TTime now; |
285 TTime now; |
283 now.UniversalTime(); |
286 now.UniversalTime(); |
290 now -= delta; |
293 now -= delta; |
291 |
294 |
292 iActiveShow->SetPubDate(now); |
295 iActiveShow->SetPubDate(now); |
293 } |
296 } |
294 |
297 |
|
298 if (iUid) |
|
299 { |
|
300 iActiveShow->SetUid(iUid); |
|
301 } |
295 |
302 |
296 iCallbacks.NewShowL(*iActiveShow); |
303 iCallbacks.NewShowL(*iActiveShow); |
297 |
304 |
298 delete iActiveShow; |
305 delete iActiveShow; |
299 |
306 |
384 DP2("Pubdate parse error: '%S', error=%d", &iBuffer, parseError); |
391 DP2("Pubdate parse error: '%S', error=%d", &iBuffer, parseError); |
385 } |
392 } |
386 } |
393 } |
387 iFeedState=EStateItem; |
394 iFeedState=EStateItem; |
388 break; |
395 break; |
|
396 case EStateItemGuid: |
|
397 iUid = DefaultHash::Des16(iBuffer); |
|
398 iFeedState=EStateItem; |
|
399 break; |
389 case EStateItemTitle: |
400 case EStateItemTitle: |
390 //DP1("title: %S", &iBuffer); |
401 //DP1("title: %S", &iBuffer); |
391 iActiveShow->SetTitleL(iBuffer); |
402 iActiveShow->SetTitleL(iBuffer); |
392 iFeedState = EStateItem; |
403 iFeedState = EStateItem; |
393 break; |
404 break; |