870 |
870 |
871 // if no shows in queue, we keep whichever state suspend is in |
871 // if no shows in queue, we keep whichever state suspend is in |
872 showsDownloading.ResetAndDestroy(); |
872 showsDownloading.ResetAndDestroy(); |
873 } |
873 } |
874 |
874 |
875 void CPodcastFeedView::OpmlParsingComplete(TUint aNumFeedsImported) |
875 void CPodcastFeedView::OpmlParsingComplete(TInt aError, TUint aNumFeedsImported) |
876 { |
876 { |
877 DP("CPodcastFeedView::OpmlParsingComplete BEGIN"); |
877 DP("CPodcastFeedView::OpmlParsingComplete BEGIN"); |
878 |
878 |
879 switch (iOpmlState) |
879 switch (aError) |
880 { |
880 { |
881 case EOpmlIdle: |
881 case KErrCouldNotConnect: |
882 break; |
882 { |
883 case EOpmlImporting: |
883 TBuf<KMaxMessageLength> message; |
884 { |
884 iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR); |
885 UpdateListboxItemsL(); |
885 ShowErrorMessage(message); |
886 delete iWaitDialog; |
886 } |
887 iOpmlState = EOpmlIdle; |
887 break; |
|
888 case KErrNone: |
|
889 default: // we don't do more error handling here, just show 0 imported feeds |
|
890 switch (iOpmlState) |
|
891 { |
|
892 case EOpmlIdle: |
|
893 break; |
|
894 case EOpmlImporting: |
|
895 { |
|
896 UpdateListboxItemsL(); |
|
897 delete iWaitDialog; |
|
898 iOpmlState = EOpmlIdle; |
|
899 |
|
900 TBuf<KMaxMessageLength> message; |
|
901 TBuf<KMaxMessageLength> templ; |
|
902 iEikonEnv->ReadResourceL(templ, R_IMPORT_FEED_SUCCESS); |
|
903 message.Format(templ, aNumFeedsImported); |
888 |
904 |
889 TBuf<KMaxMessageLength> message; |
905 if(ShowQueryMessage(message)) |
890 TBuf<KMaxMessageLength> templ; |
906 { |
891 iEikonEnv->ReadResourceL(templ, R_IMPORT_FEED_SUCCESS); |
907 HandleCommandL(EPodcastUpdateAllFeeds); |
892 message.Format(templ, aNumFeedsImported); |
908 } |
893 |
909 } |
894 if(ShowQueryMessage(message)) |
910 break; |
895 { |
911 case EOpmlSearching: |
896 HandleCommandL(EPodcastUpdateAllFeeds); |
912 delete iWaitDialog; |
897 } |
913 if (iPodcastModel.FeedEngine().GetSearchResults().Count() == 0) |
898 } |
914 { |
899 break; |
915 TBuf<KMaxMessageLength> message; |
900 case EOpmlSearching: |
916 iEikonEnv->ReadResourceL(message, R_SEARCH_NORESULTS); |
901 delete iWaitDialog; |
917 ShowErrorMessage(message); |
902 if (iPodcastModel.FeedEngine().GetSearchResults().Count() == 0) |
918 } |
903 { |
919 else |
904 TBuf<KMaxMessageLength> message; |
920 { |
905 iEikonEnv->ReadResourceL(message, R_SEARCH_NORESULTS); |
921 AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID, TUid::Uid(0), KNullDesC8()); |
906 ShowErrorMessage(message); |
922 } |
907 } |
923 iOpmlState = EOpmlIdle; |
908 else |
924 break; |
909 { |
925 default: |
910 AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID, TUid::Uid(0), KNullDesC8()); |
926 break; |
911 } |
927 } |
912 iOpmlState = EOpmlIdle; |
|
913 default: |
|
914 break; |
|
915 } |
928 } |
916 |
929 |
917 DP("CPodcastFeedView::OpmlParsingComplete END"); |
930 DP("CPodcastFeedView::OpmlParsingComplete END"); |
918 } |
931 } |
919 |
932 |