photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp
branchRCL_3
changeset 13 bcb43dc84c44
parent 12 ce1c7ad1f18b
child 15 191387a8b767
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
    30 #include <glxicons.mbg>
    30 #include <glxicons.mbg>
    31 #include <glxlog.h>    // Logging
    31 #include <glxlog.h>    // Logging
    32 #include <glxtracer.h>
    32 #include <glxtracer.h>
    33 #include <glxdrmutility.h>
    33 #include <glxdrmutility.h>
    34 #include <mglxmedialist.h>
    34 #include <mglxmedialist.h>
       
    35 #include <caf/caferr.h>
    35 _LIT(KGlxIconsFilename, "glxicons.mif");
    36 _LIT(KGlxIconsFilename, "glxicons.mif");
    36 
    37 
    37 
    38 
    38 // ----------------------------------------------------------------------------
    39 // ----------------------------------------------------------------------------
    39 // NewL
    40 // NewL
   128     //URI length could be zero for Media Id based Thumbnail fetch
   129     //URI length could be zero for Media Id based Thumbnail fetch
   129     else if ( fsTnmAvailable ) 
   130     else if ( fsTnmAvailable ) 
   130 	    {
   131 	    {
   131 	    GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
   132 	    GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
   132 	    TMPXGeneralCategory cat = aMedia.Category();
   133 	    TMPXGeneralCategory cat = aMedia.Category();
       
   134 	    //Check if media is DRM rights protected
   133 	    if(drm)
   135 	    if(drm)
   134             {
   136             {
   135 
   137 
   136             //Fix for ESLM-82WJ59: call 'CheckDisplayRightsL' only for focused item
   138             //call 'DisplayItemRightsCheckL' only for focused item
   137             if(aIsFocused)
   139             if(aIsFocused)
   138             	{
   140             	{
   139             	expired = !iDrmUtility->CheckDisplayRightsL(uri, (cat == EMPXImage));
   141             	expired = !iDrmUtility->DisplayItemRightsCheckL(uri, (cat == EMPXImage));
   140             	}
   142             	}
   141             else
   143             else
   142             	{
   144             	{
   143             	//Fix for ESLM-82WJ59: for validity check of non-focused item
   145             	//call 'ItemRightsValidityCheckL' for validity check of non-focused item
   144             	expired = !iDrmUtility->CheckOpenRightsL(uri, (cat == EMPXImage));
   146             	expired = !iDrmUtility->ItemRightsValidityCheckL(uri, (cat == EMPXImage));
   145             	}
   147             	}
   146 
   148 
   147             //Fix for ESLM-82WJ59: mush easier to understand.
   149             //Check If DRM rights have expired.
   148             if( expired )
   150             if( expired )
   149                 {
   151                 {
   150                 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL(
   152                 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL(
   151                                                                     EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
   153                                                                     EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
   152                 }
   154                 }
   174         TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( 
   176         TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( 
   175     	    icon.bitmapId, resFile, defaultSize ).Id() );
   177     	    icon.bitmapId, resFile, defaultSize ).Id() );
   176         }
   178         }
   177 	else if ( (KErrNone == thumbnailError) || (KErrArgument == thumbnailError) 
   179 	else if ( (KErrNone == thumbnailError) || (KErrArgument == thumbnailError) 
   178         || (KErrDiskFull == thumbnailError) || (KErrNoMemory == thumbnailError) 
   180         || (KErrDiskFull == thumbnailError) || (KErrNoMemory == thumbnailError) 
   179 		|| ( drm && isValid == EGlxDrmRightsInvalid ) )
   181 		|| ( drm && isValid == EGlxDrmRightsInvalid ) 
       
   182 		|| thumbnailError == KErrCANoRights )
   180 	    {
   183 	    {
   181 		//Try and see if we can scale and show the grid tnm else show the default
   184 		//Try and see if we can scale and show the grid tnm else show the default
   182 	    TBool isGridTnmShown = EFalse;		
   185 	    TBool isGridTnmShown = EFalse;		
   183 	    if(HasRelevantThumbnail(aMedia,defaultSize))
   186 	    if(HasRelevantThumbnail(aMedia,defaultSize))
   184 	        {
   187 	        {