photosgallery/common/src/glxfilterfactory.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 13 bcb43dc84c44
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
   228 
   228 
   229 // ---------------------------------------------------------------------------
   229 // ---------------------------------------------------------------------------
   230 // Creates a filter most suited for the SlideShow
   230 // Creates a filter most suited for the SlideShow
   231 // ---------------------------------------------------------------------------
   231 // ---------------------------------------------------------------------------
   232 //   
   232 //   
   233 EXPORT_C CMPXFilter* TGlxFilterFactory::CreateSlideShowFilterFromExistingFilterL(   CMPXFilter* aOriginalFilter,
   233 EXPORT_C CMPXFilter* TGlxFilterFactory::CreateSlideShowFilterFromExistingFilterL(
   234                                                                                     CMPXCollectionPath* aSelectedListPath,
   234         CMPXFilter* aOriginalFilter, CMPXCollectionPath* aSelectedListPath,
   235                                                                                     TBool aReverseSortDirection)
   235         TBool aReverseSortDirection)
   236     {     
   236     {
   237     TGlxFilterProperties filterProperties;
   237     TGlxFilterProperties filterProperties;
   238     filterProperties.iSortDirection = aReverseSortDirection ? EGlxFilterSortDirectionReverse : EGlxFilterSortDirectionNotUsed;
   238     // Ref:NShwSlideshow::TPlayDirection
       
   239 	// EPlayForwards = 0; Chronological Order (Older to newer)
       
   240     // EPlayBackwards = 1; Reverse Chronological Order (Newer to older)
       
   241     filterProperties.iSortDirection = aReverseSortDirection ? 
       
   242             EGlxFilterSortDirectionNotUsed : EGlxFilterSortDirectionReverse;
   239     filterProperties.iItemType = EGlxFilterImage;
   243     filterProperties.iItemType = EGlxFilterImage;
   240     filterProperties.iPath = aSelectedListPath;
   244     filterProperties.iPath = aSelectedListPath;
   241     filterProperties.iNoDRM = ETrue;;
   245     filterProperties.iNoDRM = ETrue;
   242     filterProperties.iExcludeAnimation = ETrue;;
   246     filterProperties.iExcludeAnimation = ETrue;
   243     return CreateCombinedFilterL(filterProperties, aOriginalFilter);
   247     return CreateCombinedFilterL(filterProperties, aOriginalFilter);
   244     }
   248     }
   245     
   249     
   246 // ---------------------------------------------------------------------------
   250 // ---------------------------------------------------------------------------
   247 // Creates a combined filter object.
   251 // Creates a combined filter object.
   453         {
   457         {
   454         filter->SetTObjectValueL<TSize>(KGlxFilterGeneralThumbnailLoadability, thumbnailLoadability);    
   458         filter->SetTObjectValueL<TSize>(KGlxFilterGeneralThumbnailLoadability, thumbnailLoadability);    
   455         }
   459         }
   456         
   460         
   457 	CMPXCollectionPath* path = aFilterProperties.iPath;
   461 	CMPXCollectionPath* path = aFilterProperties.iPath;
       
   462 	TBool deletePath = EFalse;
   458 	if( aOriginalFilter->IsSupported(KGlxFilterGeneralMPXCollectionPath) )
   463 	if( aOriginalFilter->IsSupported(KGlxFilterGeneralMPXCollectionPath) )
   459         {
   464         {
   460         if( !aOverrideOriginal || !aFilterProperties.iPath )
   465         if( !aOverrideOriginal || !aFilterProperties.iPath )
   461         	{
   466         	{
   462         	path = aOriginalFilter->ValueCObjectL<CMPXCollectionPath>(KGlxFilterGeneralMPXCollectionPath);
   467         	path = aOriginalFilter->ValueCObjectL<CMPXCollectionPath>(KGlxFilterGeneralMPXCollectionPath);
       
   468         	CleanupStack::PushL(path);
       
   469         	deletePath = ETrue;
   463         	}
   470         	}
   464         }
   471         }
   465     if( path )
   472     if( path )
   466         {
   473         {
       
   474 		// SetCObjectValueL creates a copy of path, so safe to destroy path after this call.
   467         filter->SetCObjectValueL<CMPXCollectionPath>(KGlxFilterGeneralMPXCollectionPath, path);    
   475         filter->SetCObjectValueL<CMPXCollectionPath>(KGlxFilterGeneralMPXCollectionPath, path);    
   468         }
   476         }
   469    
   477     if(deletePath)
       
   478         {
       
   479         CleanupStack::PopAndDestroy(path);
       
   480         }
   470 	TBool promoteSystemItems = aFilterProperties.iPromoteSystemItems;
   481 	TBool promoteSystemItems = aFilterProperties.iPromoteSystemItems;
   471 	if( aOriginalFilter->IsSupported(KGlxFilterGeneralSortOrderPromoteSystemItems) )
   482 	if( aOriginalFilter->IsSupported(KGlxFilterGeneralSortOrderPromoteSystemItems) )
   472         {
   483         {
   473         if( !aOverrideOriginal || !aFilterProperties.iPromoteSystemItems )
   484         if( !aOverrideOriginal || !aFilterProperties.iPromoteSystemItems )
   474         	{
   485         	{