engine/src/FeedEngine.cpp
changeset 7 a7a43293ae56
parent 2 29cda98b007e
child 8 aab3aa4acdd6
--- a/engine/src/FeedEngine.cpp	Thu Feb 25 16:47:16 2010 +0000
+++ b/engine/src/FeedEngine.cpp	Thu Feb 25 17:12:04 2010 +0000
@@ -583,40 +583,44 @@
 				}break;
 			}
 		
-		NotifyFeedUpdateComplete(aError);
-
-		// we will wait until the image has been downloaded to start the next feed update.
-		if (iClientState == EIdle)
+			NotifyFeedUpdateComplete(aError);
+	
+			// we will wait until the image has been downloaded to start the next feed update.
+			if (iClientState == EIdle)
+				{
+				UpdateNextFeedL();	
+				}
+			}break;
+		case EUpdatingImage:
+			{
+			// change client state to not updating
+			iClientState = EIdle;
+	
+			NotifyFeedUpdateComplete(aError);
+			UpdateNextFeedL();
+			}break;
+		case ESearching: 
 			{
-			UpdateNextFeedL();	
-			}
-		}break;
-	case EUpdatingImage:
-		{
-		// change client state to not updating
-		iClientState = EIdle;
-
-		NotifyFeedUpdateComplete(aError);
-		UpdateNextFeedL();
-		}break;
-	case ESearching: 
-		{
-		iClientState = EIdle;
-
-		DP2("Search complete, results in %S with error %d", &iSearchResultsFileName, aError);
-		if(aError == KErrNone)
-			{
-			if (!iOpmlParser) 
+			iClientState = EIdle;
+	
+			DP2("Search complete, results in %S with error %d", &iSearchResultsFileName, aError);
+			if(aError == KErrNone)
 				{
-				iOpmlParser = new COpmlParser(*this, iPodcastModel.FsSession());
+				if (!iOpmlParser) 
+					{
+					iOpmlParser = new COpmlParser(*this, iPodcastModel.FsSession());
+					}
+	
+				DP("Parsing OPML");
+				iOpmlParser->ParseOpmlL(iSearchResultsFileName, ETrue);
 				}
-
-			DP("Parsing OPML");
-			iOpmlParser->ParseOpmlL(iSearchResultsFileName, ETrue);
-			}
-		
-		BaflUtils::DeleteFile(iPodcastModel.FsSession(), iSearchResultsFileName);
-		}break;
+			else
+				{
+				NotifyOpmlParsingComplete(aError, 0);
+				}
+			
+			BaflUtils::DeleteFile(iPodcastModel.FsSession(), iSearchResultsFileName);
+			}break;
 		}
 	DP("CFeedEngine::CompleteL END");
 	}
@@ -1063,15 +1067,15 @@
 	}
 
 
-EXPORT_C void CFeedEngine::OpmlParsingComplete(TUint aNumFeedsAdded)
+EXPORT_C void CFeedEngine::OpmlParsingComplete(TInt aError, TUint aNumFeedsAdded)
 	{
-	NotifyOpmlParsingComplete(aNumFeedsAdded);
+	NotifyOpmlParsingComplete(aError, aNumFeedsAdded);
 	}
 
-void CFeedEngine::NotifyOpmlParsingComplete(TUint aNumFeedsAdded)
+void CFeedEngine::NotifyOpmlParsingComplete(TInt aError, TUint aNumFeedsAdded)
 	{
 	for (TInt i=0;i<iObservers.Count();i++) 
 		{
-		iObservers[i]->OpmlParsingComplete(aNumFeedsAdded);
+		iObservers[i]->OpmlParsingComplete(aError, aNumFeedsAdded);
 		}
 	}