243 { |
243 { |
244 UpdateShowItemL(info->Uid(), aBytesOfCurrentDownload); |
244 UpdateShowItemL(info->Uid(), aBytesOfCurrentDownload); |
245 } |
245 } |
246 } |
246 } |
247 |
247 |
248 void CPodcastShowsView::ShowDownloadFinishedL(TUint /*aShowUid*/, TInt aError) |
248 void CPodcastShowsView::ShowDownloadFinishedL(TUint aShowUid, TInt aError) |
249 { |
249 { |
250 iProgressAdded = EFalse; |
250 iProgressAdded = EFalse; |
|
251 CShowInfo *info = NULL; |
|
252 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
253 |
|
254 for (TInt i=0;i<fItems.Count();i++) |
|
255 { |
|
256 if (fItems[i]->Uid() == aShowUid) |
|
257 { |
|
258 info = fItems[i]; |
|
259 } |
|
260 } |
|
261 |
|
262 if (info == NULL) { |
|
263 return; |
|
264 } |
251 |
265 |
252 switch(aError) |
266 switch(aError) |
253 { |
267 { |
254 case KErrCouldNotConnect: |
268 case KErrCouldNotConnect: |
255 { |
269 { |
334 } |
348 } |
335 |
349 |
336 void CPodcastShowsView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
350 void CPodcastShowsView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
337 { |
351 { |
338 TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
352 TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
339 TUint showDownloadingUid = iPodcastModel.ShowEngine().ShowDownloading() ? iPodcastModel.ShowEngine().ShowDownloading()->Uid() : 0; |
353 |
340 |
354 switch (aShowInfo->DownloadState()) |
341 if (showDownloadingUid == aShowInfo->Uid()) |
355 { |
342 { |
356 case EDownloaded: |
343 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
357 if (aShowInfo->PlayState() == ENeverPlayed) { |
344 } |
358 aIconIndex = EDownloadedNewShowIcon; |
345 else |
359 } else { |
346 { |
360 aIconIndex = EDownloadedShowIcon; |
347 switch (aShowInfo->DownloadState()) |
361 } |
348 { |
362 break; |
349 case EDownloaded: |
363 case ENotDownloaded: |
350 if (aShowInfo->PlayState() == ENeverPlayed) { |
364 if (aShowInfo->PlayState() == ENeverPlayed) { |
351 aIconIndex = EDownloadedNewShowIcon; |
365 aIconIndex = ENewShowIcon; |
352 } else { |
366 } else { |
353 aIconIndex = EDownloadedShowIcon; |
367 aIconIndex = EShowIcon; |
354 } |
368 } |
355 break; |
369 break; |
356 case ENotDownloaded: |
370 case EQueued: |
357 if (aShowInfo->PlayState() == ENeverPlayed) { |
371 aIconIndex = dlStop ? ESuspendedShowIcon : EQuedShowIcon; |
358 aIconIndex = ENewShowIcon; |
372 break; |
359 } else { |
373 case EDownloading: |
360 aIconIndex = EShowIcon; |
374 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
361 } |
375 break; |
362 break; |
376 case EFailedDownload: |
363 case EQueued: |
377 aIconIndex = EFailedShowIcon; |
364 aIconIndex = dlStop ? ESuspendedShowIcon : EQuedShowIcon; |
378 break; |
365 break; |
|
366 case EDownloading: |
|
367 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
|
368 break; |
|
369 case EFailedDownload: |
|
370 aIconIndex = EFailedShowIcon; |
|
371 break; |
|
372 } |
|
373 } |
379 } |
374 } |
380 } |
375 |
381 |
376 |
382 |
377 void CPodcastShowsView::UpdateFeedUpdateStateL() |
383 void CPodcastShowsView::UpdateFeedUpdateStateL() |
812 } |
818 } |
813 |
819 |
814 void CPodcastShowsView::DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows) |
820 void CPodcastShowsView::DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows) |
815 { |
821 { |
816 ((CPodcastAppUi*)AppUi())->UpdateQueueTab(aDownloadingShows+aQueuedShows); |
822 ((CPodcastAppUi*)AppUi())->UpdateQueueTab(aDownloadingShows+aQueuedShows); |
|
823 UpdateListboxItemsL(); |
817 } |
824 } |
818 |
825 |
819 void CPodcastShowsView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
826 void CPodcastShowsView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
820 { |
827 { |
821 UpdateListboxItemsL(); |
828 UpdateListboxItemsL(); |