581 } |
581 } |
582 } |
582 } |
583 }break; |
583 }break; |
584 } |
584 } |
585 |
585 |
586 NotifyFeedUpdateComplete(aError); |
586 NotifyFeedUpdateComplete(aError); |
587 |
587 |
588 // we will wait until the image has been downloaded to start the next feed update. |
588 // we will wait until the image has been downloaded to start the next feed update. |
589 if (iClientState == EIdle) |
589 if (iClientState == EIdle) |
590 { |
|
591 UpdateNextFeedL(); |
|
592 } |
|
593 }break; |
|
594 case EUpdatingImage: |
|
595 { |
|
596 // change client state to not updating |
|
597 iClientState = EIdle; |
|
598 |
|
599 NotifyFeedUpdateComplete(aError); |
|
600 UpdateNextFeedL(); |
|
601 }break; |
|
602 case ESearching: |
|
603 { |
|
604 iClientState = EIdle; |
|
605 |
|
606 DP2("Search complete, results in %S with error %d", &iSearchResultsFileName, aError); |
|
607 if(aError == KErrNone) |
|
608 { |
|
609 if (!iOpmlParser) |
|
610 { |
590 { |
611 iOpmlParser = new COpmlParser(*this, iPodcastModel.FsSession()); |
591 UpdateNextFeedL(); |
612 } |
592 } |
613 |
593 }break; |
614 DP("Parsing OPML"); |
594 case EUpdatingImage: |
615 iOpmlParser->ParseOpmlL(iSearchResultsFileName, ETrue); |
595 { |
616 } |
596 // change client state to not updating |
617 |
597 iClientState = EIdle; |
618 BaflUtils::DeleteFile(iPodcastModel.FsSession(), iSearchResultsFileName); |
598 |
619 }break; |
599 NotifyFeedUpdateComplete(aError); |
|
600 UpdateNextFeedL(); |
|
601 }break; |
|
602 case ESearching: |
|
603 { |
|
604 iClientState = EIdle; |
|
605 |
|
606 DP2("Search complete, results in %S with error %d", &iSearchResultsFileName, aError); |
|
607 if(aError == KErrNone) |
|
608 { |
|
609 if (!iOpmlParser) |
|
610 { |
|
611 iOpmlParser = new COpmlParser(*this, iPodcastModel.FsSession()); |
|
612 } |
|
613 |
|
614 DP("Parsing OPML"); |
|
615 iOpmlParser->ParseOpmlL(iSearchResultsFileName, ETrue); |
|
616 } |
|
617 else |
|
618 { |
|
619 NotifyOpmlParsingComplete(aError, 0); |
|
620 } |
|
621 |
|
622 BaflUtils::DeleteFile(iPodcastModel.FsSession(), iSearchResultsFileName); |
|
623 }break; |
620 } |
624 } |
621 DP("CFeedEngine::CompleteL END"); |
625 DP("CFeedEngine::CompleteL END"); |
622 } |
626 } |
623 |
627 |
624 void CFeedEngine::NotifyFeedUpdateComplete(TInt aError) |
628 void CFeedEngine::NotifyFeedUpdateComplete(TInt aError) |
1061 { |
1065 { |
1062 return iSearchResults; |
1066 return iSearchResults; |
1063 } |
1067 } |
1064 |
1068 |
1065 |
1069 |
1066 EXPORT_C void CFeedEngine::OpmlParsingComplete(TUint aNumFeedsAdded) |
1070 EXPORT_C void CFeedEngine::OpmlParsingComplete(TInt aError, TUint aNumFeedsAdded) |
1067 { |
1071 { |
1068 NotifyOpmlParsingComplete(aNumFeedsAdded); |
1072 NotifyOpmlParsingComplete(aError, aNumFeedsAdded); |
1069 } |
1073 } |
1070 |
1074 |
1071 void CFeedEngine::NotifyOpmlParsingComplete(TUint aNumFeedsAdded) |
1075 void CFeedEngine::NotifyOpmlParsingComplete(TInt aError, TUint aNumFeedsAdded) |
1072 { |
1076 { |
1073 for (TInt i=0;i<iObservers.Count();i++) |
1077 for (TInt i=0;i<iObservers.Count();i++) |
1074 { |
1078 { |
1075 iObservers[i]->OpmlParsingComplete(aNumFeedsAdded); |
1079 iObservers[i]->OpmlParsingComplete(aError, aNumFeedsAdded); |
1076 } |
1080 } |
1077 } |
1081 } |