upnpavcontrolpoint/avcpengine/src/upnpbrowsecommand.cpp
changeset 34 eab116a48b80
parent 0 7f85d04be362
equal deleted inserted replaced
33:6ac064bb53eb 34:eab116a48b80
   146 void CUpnpBrowseCommand::SetResultL(const RMessage2& aMessage) 
   146 void CUpnpBrowseCommand::SetResultL(const RMessage2& aMessage) 
   147 	{
   147 	{
   148 	//ASSERT(aMessage.Function() == EDownloadDirList);
   148 	//ASSERT(aMessage.Function() == EDownloadDirList);
   149 
   149 
   150      TInt size = iResult.Count();
   150      TInt size = iResult.Count();
   151       TFileInfo* dirs = new  TFileInfo[size];
   151      TFileInfo* dirs = new  TFileInfo[size];
       
   152      CleanupStack::PushL(TCleanupItem(CleanupArray, dirs));
   152       for (TInt i = 0; i < size; i++) 
   153       for (TInt i = 0; i < size; i++) 
   153       	{
   154       	{
   154          dirs[i] = iResult[i];
   155          dirs[i] = iResult[i];
   155       	}
   156       	}
   156       TPtr8 result(reinterpret_cast<TUint8*>(dirs), sizeof(TFileInfo)*size, sizeof(TFileInfo)*size);          
   157       TPtr8 result(reinterpret_cast<TUint8*>(dirs), sizeof(TFileInfo)*size, sizeof(TFileInfo)*size);          
   157       aMessage.WriteL(1, result);  
   158       aMessage.WriteL(1, result);  
   158       delete[] dirs;
   159 	  CleanupStack::PopAndDestroy(dirs);
   159 	}
   160 	}
       
   161 	
       
   162 // -----------------------------------------------------------------------------
       
   163 // CUpnpBrowseCommand::CleanupArray
       
   164 // -----------------------------------------------------------------------------
       
   165 // 
       
   166 void CUpnpBrowseCommand::CleanupArray(TAny* aDirs)
       
   167     {
       
   168     TFileInfo* dirs = (TFileInfo*) aDirs ;
       
   169     delete[] dirs;
       
   170     }
   160 
   171 
   161 
   172 
   162 // -----------------------------------------------------------------------------
   173 // -----------------------------------------------------------------------------
   163 // CUpnpBrowseCommand::SetAttForObject
   174 // CUpnpBrowseCommand::SetAttForObject
   164 // -----------------------------------------------------------------------------
   175 // -----------------------------------------------------------------------------