mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetobjecthandles.cpp
branchRCL_3
changeset 18 453dfc402455
parent 15 f85613f12947
equal deleted inserted replaced
17:dbd1c5e08735 18:453dfc402455
   105             }
   105             }
   106         }
   106         }
   107     
   107     
   108     iTimeoutCount = 0;
   108     iTimeoutCount = 0;
   109     
   109     
   110 	RMTPObjectMgrQueryContext   context;
       
   111 	RArray<TUint>               handles;
       
   112 	CleanupClosePushL(context);
       
   113 	CleanupClosePushL(handles);
       
   114 	delete iHandles;
   110 	delete iHandles;
   115 	iHandles = CMTPTypeArray::NewL(EMTPTypeAUINT32);
   111 	iHandles = CMTPTypeArray::NewL(EMTPTypeAUINT32);
   116 
   112 
   117     __FLOG_VA((_L8("IsConnectMac = %d; ERequestParameter2 = %d" ), iDevDpSingletons.DeviceDataStore().IsConnectMac(), Request().Uint32(TMTPTypeRequest::ERequestParameter2)));
   113     __FLOG_VA((_L8("IsConnectMac = %d; ERequestParameter2 = %d" ), iDevDpSingletons.DeviceDataStore().IsConnectMac(), Request().Uint32(TMTPTypeRequest::ERequestParameter2)));
   118 	if(iDevDpSingletons.DeviceDataStore().IsConnectMac()
   114 	if(iDevDpSingletons.DeviceDataStore().IsConnectMac()
   119        &&(KMTPFormatsAll == Request().Uint32(TMTPTypeRequest::ERequestParameter2)))
   115        &&(KMTPFormatsAll == Request().Uint32(TMTPTypeRequest::ERequestParameter2)))
   120         {
   116         {
   121         __FLOG(_L8("ConnectMac and Fetch all."));
   117         __FLOG(_L8("ConnectMac and Fetch all."));
   122         //get folder object handles
   118         HandleObjectHandlesUnderMacL(*iHandles);
   123     	TMTPObjectMgrQueryParams    paramsFolder(Request().Uint32(TMTPTypeRequest::ERequestParameter1), EMTPFormatCodeAssociation, Request().Uint32(TMTPTypeRequest::ERequestParameter3));	
       
   124     	do
       
   125     	    {
       
   126         	iFramework.ObjectMgr().GetObjectHandlesL(paramsFolder, context, handles);
       
   127         	iHandles->AppendL(handles);
       
   128     	    }
       
   129     	while (!context.QueryComplete());
       
   130 
       
   131         //get script object handles
       
   132     	RMTPObjectMgrQueryContext   contextScript;
       
   133     	RArray<TUint>               handlesScript;
       
   134     	CleanupClosePushL(contextScript);
       
   135     	CleanupClosePushL(handlesScript);            
       
   136     	TMTPObjectMgrQueryParams    paramsScript(Request().Uint32(TMTPTypeRequest::ERequestParameter1), EMTPFormatCodeScript, Request().Uint32(TMTPTypeRequest::ERequestParameter3));	
       
   137     	do
       
   138     	    {
       
   139         	iFramework.ObjectMgr().GetObjectHandlesL(paramsScript, contextScript, handlesScript);
       
   140         	iHandles->AppendL(handlesScript);
       
   141     	    }
       
   142     	while (!contextScript.QueryComplete());
       
   143     	CleanupStack::PopAndDestroy(&contextScript);
       
   144     	CleanupStack::PopAndDestroy(&handlesScript);        
       
   145 
       
   146         //get image object handles
       
   147     	RMTPObjectMgrQueryContext   contextImage;
       
   148     	RArray<TUint>               handlesImage;
       
   149     	CleanupClosePushL(contextImage);
       
   150     	CleanupClosePushL(handlesImage);            
       
   151     	TMTPObjectMgrQueryParams    paramsImage(Request().Uint32(TMTPTypeRequest::ERequestParameter1), EMTPFormatCodeEXIFJPEG, Request().Uint32(TMTPTypeRequest::ERequestParameter3));	
       
   152     	do
       
   153     	    {
       
   154         	iFramework.ObjectMgr().GetObjectHandlesL(paramsImage, contextImage, handlesImage);
       
   155         	iHandles->AppendL(handlesImage);
       
   156     	    }
       
   157     	while (!contextImage.QueryComplete());
       
   158     	CleanupStack::PopAndDestroy(&contextImage);
       
   159     	CleanupStack::PopAndDestroy(&handlesImage);                            
       
   160         }
   119         }
   161     else
   120     else
   162         {
   121         {
       
   122     	RMTPObjectMgrQueryContext   context;
       
   123     	RArray<TUint>               handles;
       
   124     	CleanupClosePushL(context);
       
   125     	CleanupClosePushL(handles);        
   163     	TMTPObjectMgrQueryParams    params(Request().Uint32(TMTPTypeRequest::ERequestParameter1), Request().Uint32(TMTPTypeRequest::ERequestParameter2), Request().Uint32(TMTPTypeRequest::ERequestParameter3));	
   126     	TMTPObjectMgrQueryParams    params(Request().Uint32(TMTPTypeRequest::ERequestParameter1), Request().Uint32(TMTPTypeRequest::ERequestParameter2), Request().Uint32(TMTPTypeRequest::ERequestParameter3));	
   164     	do
   127     	do
   165     	    {
   128     	    {
   166         	iFramework.ObjectMgr().GetObjectHandlesL(params, context, handles);
   129         	iFramework.ObjectMgr().GetObjectHandlesL(params, context, handles);
   167 			
   130 			
   192 	            StorageSuid = NULL;
   155 	            StorageSuid = NULL;
   193 	            CleanupStack::PopAndDestroy();
   156 	            CleanupStack::PopAndDestroy();
   194             	}
   157             	}
   195         	iHandles->AppendL(handles);
   158         	iHandles->AppendL(handles);
   196     	    }
   159     	    }
   197     	while (!context.QueryComplete());        
   160     	while (!context.QueryComplete()); 
       
   161     	CleanupStack::PopAndDestroy(&handles);
       
   162     	CleanupStack::PopAndDestroy(&context);        
   198         }        
   163         }        
   199     	
   164     						
   200         
       
   201 
       
   202 	CleanupStack::PopAndDestroy(&handles);
       
   203 	CleanupStack::PopAndDestroy(&context);					
       
   204 	SendDataL(*iHandles);
   165 	SendDataL(*iHandles);
   205     __FLOG(_L8("ServiceL - Exit"));	    
   166     __FLOG(_L8("ServiceL - Exit"));	    
   206 	}
   167 	}
   207 	
   168