photosgallery/viewframework/medialists/src/glxattributecontext.cpp
branchRCL_3
changeset 75 01504893d9cb
parent 64 34937ec34dac
equal deleted inserted replaced
68:5b238bc8ffb6 75:01504893d9cb
   170             // See EMYP-79VDHP
   170             // See EMYP-79VDHP
   171             error = KErrNone;
   171             error = KErrNone;
   172             }
   172             }
   173         }
   173         }
   174     
   174     
       
   175     
   175     // If the attribute request is for Thumbnail, Check if there is a match found.
   176     // If the attribute request is for Thumbnail, Check if there is a match found.
   176     // And set the size and thumbnail quality
   177     // And set the size and thumbnail quality
   177 	TIdentityRelation<TMPXAttribute> matchContent(&TMPXAttribute::MatchContentId);
   178 	TIdentityRelation<TMPXAttribute> matchContent(&TMPXAttribute::MatchContentId);
   178 	TMPXAttribute tnAttr(KGlxMediaIdThumbnail, 0);
   179 	TMPXAttribute tnAttr(KGlxMediaIdThumbnail, 0);
   179 	
   180 	
   180 	if (aAttributes.Find(tnAttr, matchContent) != KErrNotFound) 
   181 	if (iAttributes.Find(tnAttr, matchContent) != KErrNotFound) 
   181 		{
   182 		{
   182 		// Allocate CMPXAttributeSpecs
   183 		// Allocate CMPXAttributeSpecs
   183 		CMPXAttributeSpecs* attributeSpecs = CMPXAttributeSpecs::NewL();
   184 		CMPXAttributeSpecs* attributeSpecs = CMPXAttributeSpecs::NewL();
   184 		CleanupStack::PushL(attributeSpecs);
   185 		CleanupStack::PushL(attributeSpecs);
   185 		
   186 		
   186 		attributeSpecs->SetTObjectValueL(
   187 	attributeSpecs->SetTObjectValueL(
   187 	    TMPXAttribute( KGlxMediaIdThumbnail,
   188 	   TMPXAttribute( KGlxMediaIdThumbnail,
   188 					   KGlxAttribSpecThumbnailSize ), 
   189 					   KGlxAttribSpecThumbnailSize ), 
   189 					   TSize(iDefaultSpecSize.iWidth,iDefaultSpecSize.iHeight) );
   190 					   TSize(iDefaultSpecSize.iWidth,iDefaultSpecSize.iHeight) );
   190 		
   191 		
   191 		attributeSpecs->SetTObjectValueL(
   192 		attributeSpecs->SetTObjectValueL(
   192 		   TMPXAttribute( KGlxMediaIdThumbnail,
   193 		   TMPXAttribute( KGlxMediaIdThumbnail,
   193 					   KGlxAttribSpecThumbnailQualityOverSpeed ), ETrue );
   194 					   KGlxAttribSpecThumbnailQualityOverSpeed ), ETrue );
   194 		
   195 		
   195 		// Memory leak guard check
       
   196 		if (aDetailedSpecs)
       
   197 		    {
       
   198             delete aDetailedSpecs;
       
   199             aDetailedSpecs = NULL;
       
   200 		    }
       
   201 		aDetailedSpecs = attributeSpecs;
   196 		aDetailedSpecs = attributeSpecs;
   202 		
   197 		
   203 		// Pop from stack
   198 		// Pop from stack
   204 		CleanupStack::Pop(attributeSpecs);
   199 		CleanupStack::Pop(attributeSpecs);
       
   200 		
   205 		}
   201 		}
   206 
   202 
   207     // If an error was found, return KErrGeneral
   203     // If an error was found, return KErrGeneral
   208     if (error != KErrNone)
   204     if (error != KErrNone)
   209         {
   205         {