383 TInt pos; |
382 TInt pos; |
384 if ( !FindVideoByMdsIdL( aMdsIds[j], pos ) ) |
383 if ( !FindVideoByMdsIdL( aMdsIds[j], pos ) ) |
385 { |
384 { |
386 MPX_DEBUG2("CVcxMyVideosVideoCache:: MDSID(%d) not found from cache, ok", aMdsIds[j]); |
385 MPX_DEBUG2("CVcxMyVideosVideoCache:: MDSID(%d) not found from cache, ok", aMdsIds[j]); |
387 |
386 |
|
387 //TODO: This doesnt work with new mds cmd queue. Cancel must be done if there is _any_ async req going on. |
|
388 // Maybe the fetching could be changed to asynchronous... |
388 if ( iCollection.iMyVideosMdsDb->iVideoListFetchingIsOngoing ) |
389 if ( iCollection.iMyVideosMdsDb->iVideoListFetchingIsOngoing ) |
389 { |
390 { |
390 // If list fetching is not canceled, CreateVideoObjectL will leave with KErrNotReady. |
391 // If list fetching is not canceled, CreateVideoObjectL will leave with KErrNotReady. |
391 MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it to be able to fetch single items!"); |
392 MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it to be able to fetch single items!"); |
392 iCollection.iMyVideosMdsDb->Cancel(); |
393 iCollection.iMyVideosMdsDb->Cancel(); |
586 |
587 |
587 MPX_DEBUG2("CVcxMyVideosVideoCache:: aForce = %d", aForce ); |
588 MPX_DEBUG2("CVcxMyVideosVideoCache:: aForce = %d", aForce ); |
588 |
589 |
589 TVcxMyVideosSortingOrder sortingOrder = SortingOrderL(); |
590 TVcxMyVideosSortingOrder sortingOrder = SortingOrderL(); |
590 |
591 |
591 if ( iCollection.iMyVideosMdsDb->iVideoListFetchingIsOngoing |
592 if ( IsFetchingVideoList |
592 && sortingOrder == iLastSortingOrder && !aForce ) |
593 && sortingOrder == iLastSortingOrder && !aForce ) |
593 { |
594 { |
594 MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping"); |
595 MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList creation is already ongoing, skipping"); |
595 return; |
596 return; |
596 } |
597 } |
597 |
598 |
598 if ( iVideoListIsPartial || (sortingOrder != iLastSortingOrder) || aForce ) |
599 if ( iVideoListIsPartial || (sortingOrder != iLastSortingOrder) || aForce ) |
599 { |
600 { |
600 MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating"); |
601 MPX_DEBUG1("CVcxMyVideosVideoCache:: iVideoList was partial or in wrong order or aForce was ETrue, recreating"); |
601 |
602 |
602 if ( iCollection.iMyVideosMdsDb->iVideoListFetchingIsOngoing ) |
603 if ( IsFetchingVideoList ) |
603 { |
604 { |
604 MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it"); |
605 MPX_DEBUG1("CVcxMyVideosVideoCache:: video list fetching is ongoing, canceling it"); |
605 iCollection.iMyVideosMdsDb->Cancel(); |
606 iCollection.iMyVideosMdsDb->Cancel( CVcxMyVideosMdsDb::EGetVideoList ); |
|
607 IsFetchingVideoList = EFalse; |
606 } |
608 } |
607 |
609 |
608 ResetVideoListL(); |
610 ResetVideoListL(); |
609 |
611 |
610 TBool ascending = ETrue; |
612 TBool ascending = ETrue; |
1489 // |
1492 // |
1490 void CVcxMyVideosVideoCache::ResetVideoListL() |
1493 void CVcxMyVideosVideoCache::ResetVideoListL() |
1491 { |
1494 { |
1492 MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL"); |
1495 MPX_FUNC("CVcxMyVideosVideoCache::ResetVideoListL"); |
1493 |
1496 |
1494 iCollection.iMyVideosMdsDb->Cancel(); |
1497 //TODO: when should we cancel... |
|
1498 //iCollection.iMyVideosMdsDb->Cancel(); |
1495 |
1499 |
1496 CMPXMediaArray* mediaArray = |
1500 CMPXMediaArray* mediaArray = |
1497 iVideoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents ); |
1501 iVideoList->ValueCObjectL<CMPXMediaArray>( KMPXMediaArrayContents ); |
1498 CleanupStack::PushL( mediaArray ); // 1-> |
1502 CleanupStack::PushL( mediaArray ); // 1-> |
1499 |
1503 |