Fix for bug 3540 - show sorting when pubDate is not set in feed symbian1
authorSebastian Brannstrom <sebastianb@symbian.org>
Sat, 16 Oct 2010 15:58:45 +0100
branchsymbian1
changeset 242 64a2995a3e08
parent 241 ed4ed5330d83
child 244 d6c20128dad5
Fix for bug 3540 - show sorting when pubDate is not set in feed
engine/src/FeedParser.cpp
--- 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;