syncmlfw/common/alertqueue/src/NSmlDSAlertParser11.cpp
branchRCL_3
changeset 61 b183ec05bd8c
parent 0 b497e44ab2fc
child 62 19bba8228ff0
equal deleted inserted replaced
59:13d7c31c74e0 61:b183ec05bd8c
    22 #include <ecom.h>
    22 #include <ecom.h>
    23 #include <barsread.h>
    23 #include <barsread.h>
    24 #include <barsc.h>
    24 #include <barsc.h>
    25 #include <s32mem.h>
    25 #include <s32mem.h>
    26 #include <data_caging_path_literals.hrh>
    26 #include <data_caging_path_literals.hrh>
    27 #include <NSmlDSTypesRes.rsg>
    27 #include <nsmldstypesres.rsg>
    28 
    28 
    29 #include <nsmlconstants.h>
    29 #include <nsmlconstants.h>
    30 #include <nsmlunicodeconverter.h>
    30 #include <nsmlunicodeconverter.h>
    31 #include <nsmldsconstants.h>
    31 #include <nsmldsconstants.h>
    32 #include "nsmldshostclient.h"
    32 #include "nsmldshostclient.h"
   215 			
   215 			
   216 		}
   216 		}
   217 
   217 
   218 	SmlMetInfMetInf_t* metInf = NULL;
   218 	SmlMetInfMetInf_t* metInf = NULL;
   219 	TPtr8 mediaType( NULL, 0, 0 );
   219 	TPtr8 mediaType( NULL, 0, 0 );
   220 	
   220 
   221 	if ( aAlert->itemList->item->meta )
   221 	if ( aAlert->itemList )
   222 		{
   222 		{
   223 		if ( aAlert->itemList->item->meta->content && 
   223 		if (aAlert->itemList->item)
   224 			aAlert->itemList->item->meta->contentType == SML_PCDATA_EXTENSION && 
   224 			{	
   225 			aAlert->itemList->item->meta->extension == SML_EXT_METINF )
   225 			if ( aAlert->itemList->item->meta )
   226 			{
   226 				{
   227 			metInf = (SmlMetInfMetInf_t*) aAlert->itemList->item->meta->content;
   227 				if ( aAlert->itemList->item->meta->content && 
       
   228 				aAlert->itemList->item->meta->contentType == SML_PCDATA_EXTENSION && 
       
   229 				aAlert->itemList->item->meta->extension == SML_EXT_METINF )
       
   230 				{
       
   231 				metInf = (SmlMetInfMetInf_t*) aAlert->itemList->item->meta->content;
   228 			
   232 			
   229 			if ( metInf->type )
   233 				if ( metInf->type )
   230 				{
   234 					{
   231 				mediaType.Set( static_cast<TUint8*>( metInf->type->content ), metInf->type->length, metInf->type->length );
   235 					mediaType.Set( static_cast<TUint8*>( metInf->type->content ), metInf->type->length, metInf->type->length );
   232 				TrimRightSpaceAndNull( mediaType );
   236 					TrimRightSpaceAndNull( mediaType );
       
   237 					}
   233 				}
   238 				}
   234 			}
   239 				}
   235 		}
       
   236 		
       
   237 	if ( aAlert->itemList )
       
   238 		{
       
   239 		if (aAlert->itemList->item)
       
   240 			{
       
   241 			if ( aAlert->itemList->item->source )
   240 			if ( aAlert->itemList->item->source )
   242 				{
   241 				{
   243 				HBufC8* remotePath = NULL;
   242 				HBufC8* remotePath = NULL;
   244 				
   243 				
   245 				TPtr8 pcdata( (TUint8*) aAlert->itemList->item->source->locURI->content, aAlert->itemList->item->source->locURI->length, aAlert->itemList->item->source->locURI->length );
   244 				TPtr8 pcdata( (TUint8*) aAlert->itemList->item->source->locURI->content, aAlert->itemList->item->source->locURI->length, aAlert->itemList->item->source->locURI->length );
   251 					{
   250 					{
   252 					MatchContentTypeL( p, mediaType, syncType, i );	
   251 					MatchContentTypeL( p, mediaType, syncType, i );	
   253 					}
   252 					}
   254 							
   253 							
   255 				CleanupStack::PopAndDestroy(); // remotePath	
   254 				CleanupStack::PopAndDestroy(); // remotePath	
   256     			}
   255     		}
   257 			}
   256 			}
   258 		}
   257 		}
   259 	
   258 	
   260 	return 0;
   259 	return 0;
   261 	}
   260 	}