209 { |
209 { |
210 MMPXCollection& collection = iRequestOwner->Collection(); |
210 MMPXCollection& collection = iRequestOwner->Collection(); |
211 // Cancel the pending attribute request |
211 // Cancel the pending attribute request |
212 collection.CancelRequest(); |
212 collection.CancelRequest(); |
213 |
213 |
|
214 #ifdef USE_S60_TNM |
214 GLX_DEBUG2("CGlxCacheManager::CancelPreviousRequest() iThumbnailRequestIds.Count() %d", iThumbnailRequestIds.Count()); |
215 GLX_DEBUG2("CGlxCacheManager::CancelPreviousRequest() iThumbnailRequestIds.Count() %d", iThumbnailRequestIds.Count()); |
215 |
216 |
216 // Check if any thumbnail requests are pending and cancel the requests. |
217 // Check if any thumbnail requests are pending and cancel the requests. |
217 for (TInt i = 0; i < iThumbnailRequestIds.Count(); i++) |
218 for (TInt i = 0; i < iThumbnailRequestIds.Count(); i++) |
218 { |
219 { |
219 iTnEngine->CancelRequest(iThumbnailRequestIds[i].iId); |
220 iTnEngine->CancelRequest(iThumbnailRequestIds[i].iId); |
220 } |
221 } |
221 iThumbnailRequestIds.Reset(); |
222 iThumbnailRequestIds.Reset(); |
|
223 #endif |
222 iRequestOwner = NULL; |
224 iRequestOwner = NULL; |
223 } |
225 } |
224 } |
226 } |
225 |
227 |
226 // ----------------------------------------------------------------------------- |
228 // ----------------------------------------------------------------------------- |
593 |
595 |
594 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
596 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
595 #ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED |
597 #ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED |
596 GLX_DEBUG2("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) itemId %d", itemId.Value()); |
598 GLX_DEBUG2("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) itemId %d", itemId.Value()); |
597 if (item.Uri().Find(KFileIdentifier) != KErrNotFound || |
599 if (item.Uri().Find(KFileIdentifier) != KErrNotFound || |
598 item.Uri().Length() == 0 && itemId.Value()) |
600 item.Uri().Length() && itemId.Value()) |
599 #else |
601 #else |
600 GLX_DEBUG1("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) Uri"); |
602 GLX_DEBUG1("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) Uri"); |
601 if (item.Uri().Find(KFileIdentifier) != KErrNotFound) |
603 if (item.Uri().Find(KFileIdentifier) != KErrNotFound) |
602 #endif |
604 #endif |
603 { |
605 { |
762 time.HomeTime(); |
764 time.HomeTime(); |
763 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralDate, time.Int64()); |
765 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralDate, time.Int64()); |
764 } |
766 } |
765 else if ( iRequestedAttrs[i] == KGlxMediaGeneralLastModifiedDate ) |
767 else if ( iRequestedAttrs[i] == KGlxMediaGeneralLastModifiedDate ) |
766 { |
768 { |
767 TTime time; |
769 if(errInImage == KErrNone) |
768 time.HomeTime(); |
770 { |
769 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, time.Int64()); |
771 RFs fs; |
|
772 fs.Connect(); |
|
773 TEntry entry; |
|
774 fs.Entry(fileName,entry); |
|
775 TTime time = entry.iModified; |
|
776 fs.Close(); |
|
777 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, time.Int64()); |
|
778 } |
|
779 else |
|
780 { |
|
781 TTime time; |
|
782 time.HomeTime(); |
|
783 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, time.Int64()); |
|
784 } |
770 } |
785 } |
771 else if ( iRequestedAttrs[i] == KMPXMediaGeneralSize ) |
786 else if ( iRequestedAttrs[i] == KMPXMediaGeneralSize ) |
772 { |
787 { |
773 if(errInImage == KErrNone) |
788 if(errInImage == KErrNone) |
774 { |
789 { |
803 else if ( iRequestedAttrs[i] == KMPXMediaGeneralMimeType ) |
818 else if ( iRequestedAttrs[i] == KMPXMediaGeneralMimeType ) |
804 { |
819 { |
805 if(errInImage == KErrNone) |
820 if(errInImage == KErrNone) |
806 { |
821 { |
807 TDataType dataType; |
822 TDataType dataType; |
808 GetMimeType(fileName, dataType); |
823 GetMimeTypeL(fileName, dataType); |
809 iMPXMedia->SetTextValueL(KMPXMediaGeneralMimeType, dataType.Des()); |
824 iMPXMedia->SetTextValueL(KMPXMediaGeneralMimeType, dataType.Des()); |
810 } |
825 } |
811 else |
826 else |
812 { |
827 { |
813 iMPXMedia->SetTextValueL(KMPXMediaGeneralMimeType, KDefaultType); |
828 iMPXMedia->SetTextValueL(KMPXMediaGeneralMimeType, KDefaultType); |
844 { |
859 { |
845 iMPXMedia->SetTextValueL(KMPXMediaGeneralComment, KNullDesC); |
860 iMPXMedia->SetTextValueL(KMPXMediaGeneralComment, KNullDesC); |
846 } |
861 } |
847 else if (iRequestedAttrs[i] == KMPXMediaDrmProtected ) |
862 else if (iRequestedAttrs[i] == KMPXMediaDrmProtected ) |
848 { |
863 { |
849 iMPXMedia->SetTObjectValueL(KMPXMediaDrmProtected, EFalse); |
864 TBool protection = iReader->GetDRMRightsL |
850 } |
865 (ContentAccess::EIsProtected); |
851 else if ( iRequestedAttrs[i] == KGlxMediaGeneralDRMRightsValid ) |
866 iMPXMedia->SetTObjectValueL(KMPXMediaDrmProtected, protection); |
852 { |
867 } |
|
868 else if ( iRequestedAttrs[i] == KGlxMediaGeneralDRMRightsValid ) |
|
869 { |
|
870 TBool canView = iReader->GetDRMRightsL(ContentAccess::ECanView); |
|
871 TInt rightsValid = canView ? |
|
872 EGlxDrmRightsValid : EGlxDrmRightsInvalid; |
853 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, |
873 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, |
854 EGlxDrmRightsValidityUnknown); |
874 rightsValid); |
855 } |
875 } |
856 else if ( iRequestedAttrs[i] == KMPXMediaGeneralCount ) |
876 else if ( iRequestedAttrs[i] == KMPXMediaGeneralCount ) |
857 { |
877 { |
858 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralCount, 1); |
878 iMPXMedia->SetTObjectValueL(KMPXMediaGeneralCount, 1); |
859 } |
879 } |
860 else if ( iRequestedAttrs[i] == KMPXMediaColDetailSpaceId ) |
880 else if ( iRequestedAttrs[i] == KMPXMediaColDetailSpaceId ) |
861 { |
881 { |
862 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
882 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
863 iMPXMedia->SetTObjectValueL(KMPXMediaColDetailSpaceId, spaceId.Value()); |
883 iMPXMedia->SetTObjectValueL(KMPXMediaColDetailSpaceId, |
|
884 spaceId.Value()); |
864 } |
885 } |
865 else if ( iRequestedAttrs[i] == KGlxMediaGeneralSlideshowableContent ) |
886 else if ( iRequestedAttrs[i] == KGlxMediaGeneralSlideshowableContent ) |
866 { |
887 { |
867 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralSlideshowableContent, -1); |
888 iMPXMedia->SetTObjectValueL(KGlxMediaGeneralSlideshowableContent, -1); |
868 } |
889 } |
1404 FindLoadingById(aId, ETrue); |
1425 FindLoadingById(aId, ETrue); |
1405 } |
1426 } |
1406 } |
1427 } |
1407 #endif |
1428 #endif |
1408 |
1429 |
1409 void CGlxCacheManager::GetMimeType(TFileName& aFileName, TDataType& aMimeType) |
1430 void CGlxCacheManager::GetMimeTypeL(TFileName& aFileName, TDataType& aMimeType) |
1410 { |
1431 { |
|
1432 TRACER("CGlxCacheManager::GetMimeTypeL"); |
|
1433 |
1411 RApaLsSession session; |
1434 RApaLsSession session; |
1412 User::LeaveIfError( session.Connect() ); |
1435 User::LeaveIfError( session.Connect() ); |
1413 CleanupClosePushL( session ); |
1436 CleanupClosePushL( session ); |
1414 |
1437 |
1415 TUid uid; |
1438 TUid uid; |
1417 CleanupStack::PopAndDestroy(&session); |
1440 CleanupStack::PopAndDestroy(&session); |
1418 |
1441 |
1419 } |
1442 } |
1420 void CGlxCacheManager::ImageReadyL(const TInt& aError, const TSize aSz) |
1443 void CGlxCacheManager::ImageReadyL(const TInt& aError, const TSize aSz) |
1421 { |
1444 { |
|
1445 TRACER("CGlxCacheManager::ImageReadyL"); |
|
1446 GLX_DEBUG2("CGlxCacheManager::ImageReadyL aError=%d", aError); |
|
1447 iImgSz = TSize(); |
1422 if(iSchedulerWait) |
1448 if(iSchedulerWait) |
1423 { |
1449 { |
1424 iSchedulerWait->AsyncStop(); |
1450 iSchedulerWait->AsyncStop(); |
1425 } |
1451 } |
|
1452 User::LeaveIfError( aError ); |
1426 iImgSz = aSz; |
1453 iImgSz = aSz; |
1427 } |
1454 } |