engine/src/FeedParser.cpp
branchsymbian1
changeset 242 64a2995a3e08
parent 88 f4b512d870e8
child 244 d6c20128dad5
--- a/engine/src/FeedParser.cpp	Sat Oct 16 15:41:38 2010 +0100
+++ b/engine/src/FeedParser.cpp	Sat Oct 16 15:58:45 2010 +0100
@@ -272,7 +272,27 @@
 			break;
 		case EStateItem:
 			if (str.CompareF(KTagItem) == 0) 
-				{				
+				{
+				
+				// check if we have a valid pubdate
+				
+				if (iActiveShow->PubDate().Int64() == 0)
+					{
+					// set pubDate to present time
+					TTime now;
+					now.UniversalTime();
+					
+					// but we want reverse sorting, so let's do a little trick...
+					TTimeIntervalHours delta;
+					delta = iItemsParsed;
+					
+					// ... remove an hour per show we've parsed so far
+					now -= delta;
+					
+					iActiveShow->SetPubDate(now);
+					}
+				
+						
 				iCallbacks.NewShowL(*iActiveShow);
 				
 				delete iActiveShow;