engine/src/FeedParser.cpp
branchRCL_3
changeset 342 9441fb8fd60d
parent 330 4cf89a7d3476
child 369 c683165bec63
equal deleted inserted replaced
341:a648d7ca5e27 342:9441fb8fd60d
    53 	iItemsParsed = 0;
    53 	iItemsParsed = 0;
    54 	iMaxItems = aMaxItems;
    54 	iMaxItems = aMaxItems;
    55 	iStoppedParsing = EFalse;
    55 	iStoppedParsing = EFalse;
    56 	iEncoding = ELatin1;
    56 	iEncoding = ELatin1;
    57 
    57 
       
    58 	TEntry entry;
       
    59 	User::LeaveIfError(iRfs.Entry(feedFileName, entry));
       
    60 	iFileSize = entry.iSize;
       
    61 	
    58 	ParseL(*parser, iRfs, feedFileName);
    62 	ParseL(*parser, iRfs, feedFileName);
    59 
    63 
    60 	CleanupStack::PopAndDestroy(parser);	
    64 	CleanupStack::PopAndDestroy(parser);	
    61 	
    65 	
    62 	//DP("ParseFeedL END");
    66 	//DP("ParseFeedL END");
   248 			//DP("LastBuildDate END");
   252 			//DP("LastBuildDate END");
   249 			TInternetDate internetDate;
   253 			TInternetDate internetDate;
   250 			TBuf8<128> temp;
   254 			TBuf8<128> temp;
   251 			temp.Copy(iBuffer);
   255 			temp.Copy(iBuffer);
   252 					
   256 					
       
   257 			DP2("iFileSize=%d, iActiveFeed->FeedFileSize()=%d", iFileSize, iActiveFeed->FeedFileSize());
       
   258 					
   253 			TRAPD(parseError, internetDate.SetDateL(temp));
   259 			TRAPD(parseError, internetDate.SetDateL(temp));
   254 			if(parseError == KErrNone) {				
   260 			if(parseError == KErrNone) {				
   255 				if (TTime(internetDate.DateTime()) > iActiveFeed->BuildDate()) {
   261 				if (TTime(internetDate.DateTime()) > iActiveFeed->BuildDate()) {
   256 					DP("Successfully parsed build date");
   262 					DP("Successfully parsed build date");
   257 					iActiveFeed->SetBuildDate(TTime(internetDate.DateTime()));
   263 					iActiveFeed->SetBuildDate(TTime(internetDate.DateTime()));
   258 				} else {
   264 				} else if (iFileSize == iActiveFeed->FeedFileSize()){
   259 					DP("*** Nothing new, aborting parsing");
   265 					DP("*** Nothing new, aborting parsing");
   260 					iStoppedParsing = ETrue;
   266 					iStoppedParsing = ETrue;
   261 				}
   267 				}
   262 			} else {
   268 			} else {
   263 				DP("Failed to parse last build date");
   269 				DP("Failed to parse last build date");
   264 			}
   270 			}
       
   271 			iActiveFeed->SetFeedFileSize(iFileSize);
   265 			iFeedState = EStateChannel;
   272 			iFeedState = EStateChannel;
   266 			}
   273 			}
   267 			break;
   274 			break;
   268 		case EStateChannelImageUrl:
   275 		case EStateChannelImageUrl:
   269 			//DP1("Image url: %S", &iBuffer);
   276 			//DP1("Image url: %S", &iBuffer);