119 iMaintainCacheCallback = new ( ELeave ) |
119 iMaintainCacheCallback = new ( ELeave ) |
120 CAsyncCallBack( TCallBack( MaintainCacheL, this ), CActive::EPriorityStandard ); |
120 CAsyncCallBack( TCallBack( MaintainCacheL, this ), CActive::EPriorityStandard ); |
121 |
121 |
122 #ifdef USE_S60_TNM |
122 #ifdef USE_S60_TNM |
123 iTnEngine = CThumbnailManager::NewL( *this); |
123 iTnEngine = CThumbnailManager::NewL( *this); |
124 iTnEngine->SetDisplayModeL( EColor64K ); |
124 iTnEngine->SetDisplayModeL( EColor16MU ); |
125 #endif |
125 #endif |
126 } |
126 } |
127 |
127 |
128 // ----------------------------------------------------------------------------- |
128 // ----------------------------------------------------------------------------- |
129 // Destructor |
129 // Destructor |
587 { |
587 { |
588 priority = attrSpecs->ValueTObjectL<TBool>(priorityAttrib); |
588 priority = attrSpecs->ValueTObjectL<TBool>(priorityAttrib); |
589 } |
589 } |
590 |
590 |
591 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
591 TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); |
592 #ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED |
|
593 GLX_DEBUG2("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) itemId %d", itemId.Value()); |
|
594 if (item.Uri().Find(KFileIdentifier) != KErrNotFound || |
|
595 item.Uri().Length() && itemId.Value()) |
|
596 #else |
|
597 GLX_DEBUG1("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) Uri"); |
592 GLX_DEBUG1("CGlxCacheManager::MaintainCacheL() requesting TN attribute (Medialist) Uri"); |
598 if (item.Uri().Find(KFileIdentifier) != KErrNotFound) |
593 if (item.Uri().Find(KFileIdentifier) != KErrNotFound) |
599 #endif |
|
600 { |
594 { |
601 #ifdef _DEBUG |
595 #ifdef _DEBUG |
602 iStartTime.HomeTime(); // Get home time |
596 iStartTime.HomeTime(); // Get home time |
603 #endif |
597 #endif |
604 if (tnSize.iWidth < KMaxGridThumbnailWidth) |
598 if (tnSize.iWidth < KMaxGridThumbnailWidth) |
633 parse.Path().Length() > KPrivateFolder().Length() && |
627 parse.Path().Length() > KPrivateFolder().Length() && |
634 parse.Path().Left( KPrivateFolder().Length() ).CompareF( KPrivateFolder ) == 0 ) |
628 parse.Path().Left( KPrivateFolder().Length() ).CompareF( KPrivateFolder ) == 0 ) |
635 { |
629 { |
636 CreateImageViewerInstanceL(); |
630 CreateImageViewerInstanceL(); |
637 GLX_DEBUG1("KGlxCollectionPluginImageViewerImplementationUid - Fetch (Private) TN!"); |
631 GLX_DEBUG1("KGlxCollectionPluginImageViewerImplementationUid - Fetch (Private) TN!"); |
638 if ( &(iImageViewerInstance->ImageFileHandle()) != NULL ) |
632 if ( &(iImageViewerInstance->ImageFileHandle()) ) |
639 { |
633 { |
640 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(iImageViewerInstance->ImageFileHandle()); |
634 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(iImageViewerInstance->ImageFileHandle()); |
641 iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(*source), spaceId, tnSize, itemId)); |
635 iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(*source), spaceId, tnSize, itemId)); |
642 CleanupStack::PopAndDestroy(source); |
636 CleanupStack::PopAndDestroy(source); |
643 } |
637 } |
651 CleanupStack::PopAndDestroy(source); |
645 CleanupStack::PopAndDestroy(source); |
652 } |
646 } |
653 } |
647 } |
654 else |
648 else |
655 { |
649 { |
656 #ifdef MEDIA_ID_BASED_TN_FETCH_ENABLED |
650 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(item.Uri(), 0); |
657 iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(itemId.Value()), spaceId, tnSize, itemId)); |
651 iThumbnailRequestIds.AppendL(TLoadingTN( |
658 #else |
652 iTnEngine->GetThumbnailL(*source), |
659 CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(item.Uri(), 0); |
653 spaceId, tnSize, itemId)); |
660 iThumbnailRequestIds.AppendL(TLoadingTN(iTnEngine->GetThumbnailL(*source), spaceId, tnSize, itemId)); |
654 CleanupStack::PopAndDestroy(source); |
661 CleanupStack::PopAndDestroy(source); |
|
662 #endif |
|
663 } |
655 } |
664 iThumbnailId = itemId; |
656 iThumbnailId = itemId; |
665 } |
657 } |
666 else |
658 else |
667 { |
659 { |
1438 void CGlxCacheManager::ThumbnailPreviewReady(MThumbnailData& aThumbnail, |
1430 void CGlxCacheManager::ThumbnailPreviewReady(MThumbnailData& aThumbnail, |
1439 TThumbnailRequestId aId) |
1431 TThumbnailRequestId aId) |
1440 { |
1432 { |
1441 TRACER("CGlxCacheManager::ThumbnailPreviewReady"); |
1433 TRACER("CGlxCacheManager::ThumbnailPreviewReady"); |
1442 TInt error = KErrNotSupported; |
1434 TInt error = KErrNotSupported; |
1443 if (aThumbnail.Bitmap() != NULL) |
1435 if ( aThumbnail.Bitmap() ) |
1444 { |
1436 { |
1445 GLX_DEBUG1("CGlxCacheManager::ThumbnailPreviewReady preview aval"); |
1437 GLX_DEBUG1("CGlxCacheManager::ThumbnailPreviewReady preview aval"); |
1446 error = KErrNone; |
1438 error = KErrNone; |
1447 } |
1439 } |
1448 ThumbnailReadyL(error, aThumbnail, aId, EFalse); |
1440 ThumbnailReadyL(error, aThumbnail, aId, EFalse); |
1564 // ----------------------------------------------------------------------------- |
1556 // ----------------------------------------------------------------------------- |
1565 // |
1557 // |
1566 void CGlxCacheManager::CreateImageViewerInstanceL() |
1558 void CGlxCacheManager::CreateImageViewerInstanceL() |
1567 { |
1559 { |
1568 TRACER("CGlxCacheManager::CreateImageViewerInstanceL"); |
1560 TRACER("CGlxCacheManager::CreateImageViewerInstanceL"); |
1569 if ( iImageViewerInstance == NULL ) |
1561 iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
1570 { |
|
1571 iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
|
1572 } |
|
1573 __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); |
1562 __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); |
1574 } |
1563 } |
1575 |
1564 |
1576 // ----------------------------------------------------------------------------- |
1565 // ----------------------------------------------------------------------------- |
1577 // DeleteImageViewerInstance |
1566 // DeleteImageViewerInstance |
1578 // ----------------------------------------------------------------------------- |
1567 // ----------------------------------------------------------------------------- |
1579 // |
1568 // |
1580 void CGlxCacheManager::DeleteImageViewerInstance() |
1569 void CGlxCacheManager::DeleteImageViewerInstance() |
1581 { |
1570 { |
1582 TRACER("CGlxCacheManager::DeleteImageViewerInstance"); |
1571 TRACER("CGlxCacheManager::DeleteImageViewerInstance"); |
1583 if ( iImageViewerInstance != NULL ) |
1572 if ( iImageViewerInstance ) |
1584 { |
1573 { |
1585 iImageViewerInstance->DeleteInstance(); |
1574 iImageViewerInstance->DeleteInstance(); |
1586 } |
1575 } |
1587 } |
1576 } |
1588 |
1577 |