mmappcomponents/audiofetcher/src/audiofetcherfilehandler.cpp
branchRCL_3
changeset 63 91d5ad76f5c6
parent 0 a2952bb97e68
child 67 16db3449d7ba
equal deleted inserted replaced
59:666f9a5a90a9 63:91d5ad76f5c6
   374     iQuery->AddPropertyFilterL( &namePropertyDef );
   374     iQuery->AddPropertyFilterL( &namePropertyDef );
   375     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   375     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   376     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   376     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   377    
   377    
   378     CMdELogicCondition& conditions = iQuery->Conditions();
   378     CMdELogicCondition& conditions = iQuery->Conditions();
       
   379     MimeFilterL( conditions );
   379     ExcludeRomFilesL( conditions );
   380     ExcludeRomFilesL( conditions );
   380    
   381    
   381     iQuery->SetResultMode( EQueryResultModeItem );
   382     iQuery->SetResultMode( EQueryResultModeItem );
   382     iQuery->FindL();
   383     iQuery->FindL();
   383     
   384     
   412     iQuery->AddPropertyFilterL( &namePropertyDef );
   413     iQuery->AddPropertyFilterL( &namePropertyDef );
   413     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   414     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   414     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   415     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   415    
   416    
   416     CMdELogicCondition& conditions = iQuery->Conditions();
   417     CMdELogicCondition& conditions = iQuery->Conditions();
       
   418     MimeFilterL( conditions );
   417     ExcludeRomFilesL( conditions );
   419     ExcludeRomFilesL( conditions );
   418     
   420     
   419     // define sort order
   421     // define sort order
   420     // iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) );
   422     // iQuery->AppendOrderRuleL( TMdEOrderRule( namePropertyDef, ESortAscending ) );
   421    
   423    
   453     iQuery->AddPropertyFilterL( &namePropertyDef );
   455     iQuery->AddPropertyFilterL( &namePropertyDef );
   454     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   456     CMdEPropertyDef& fileTypePropertyDef = PropertyDefL( EAttrMediaType );
   455     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   457     iQuery->AddPropertyFilterL( &fileTypePropertyDef );
   456    
   458    
   457     CMdELogicCondition& conditions = iQuery->Conditions();
   459     CMdELogicCondition& conditions = iQuery->Conditions();
       
   460     MimeFilterL( conditions );
   458     ExcludeRomFilesL( conditions );
   461     ExcludeRomFilesL( conditions );
   459    
   462    
   460     iQuery->SetResultMode( EQueryResultModeItem );
   463     iQuery->SetResultMode( EQueryResultModeItem );
   461     iQuery->FindL();
   464     iQuery->FindL();
   462     
   465     
   698     CMdEObjectCondition& cond = aCondition.AddObjectConditionL(
   701     CMdEObjectCondition& cond = aCondition.AddObjectConditionL(
   699                                 EObjectConditionCompareUriBeginsWith, KDriveZ );
   702                                 EObjectConditionCompareUriBeginsWith, KDriveZ );
   700     cond.SetNegate( ETrue );
   703     cond.SetNegate( ETrue );
   701     }
   704     }
   702 
   705 
       
   706 // -----------------------------------------------------------------------------
       
   707 // CAudioFetcherFileHandler::MimeFilterL
       
   708 // 
       
   709 // -----------------------------------------------------------------------------
       
   710 //
       
   711 void CAudioFetcherFileHandler::MimeFilterL( CMdELogicCondition& aCondition )
       
   712     {
       
   713     WLOG("CAudioFetcherFileHandler::MimeFilterL");
       
   714 
       
   715     if( iMimeTypeArray )
       
   716         {
       
   717 		if ( iMimeTypeArray->MdcaCount() > 0 )
       
   718 			{
       
   719 			CMdELogicCondition& cond =
       
   720 					aCondition.AddLogicConditionL( ELogicConditionOperatorOr );
       
   721 			for ( TInt i = 0; i < iMimeTypeArray->MdcaCount(); i++ )
       
   722 				{
       
   723 				TPtrC ptr = iMimeTypeArray->MdcaPoint(i);
       
   724 							
       
   725 				cond.AddPropertyConditionL( 
       
   726                     iSession->GetDefaultNamespaceDefL().GetObjectDefL(
       
   727                     MdeConstants::Image::KImageObject ).GetPropertyDefL( 
       
   728                     MdeConstants::Object::KItemTypeProperty ),
       
   729                     ETextPropertyConditionCompareEquals, ptr  );
       
   730 				}
       
   731 			}
       
   732     	}
       
   733     }
       
   734 
       
   735 // -----------------------------------------------------------------------------
       
   736 // CAudioFetcherFileHandler::SetMimeType
       
   737 // 
       
   738 // -----------------------------------------------------------------------------
       
   739 //
       
   740 void CAudioFetcherFileHandler::SetMimeType( const MDesCArray& aMimeTypeArray )
       
   741     {
       
   742     WLOG("CAudioFetcherFileHandler::SetMimeType");
       
   743     iMimeTypeArray = &aMimeTypeArray;
       
   744     }
   703 
   745 
   704 // -------------------------------------------------------------------------------
   746 // -------------------------------------------------------------------------------
   705 // CAudioFetcherFileHandler::StrCopy
   747 // CAudioFetcherFileHandler::StrCopy
   706 //
   748 //
   707 // String copy with lenght check.
   749 // String copy with lenght check.