--- a/mtpfws/mtpfw/dataproviders/dputility/src/cmtpgetformatcapabilities.cpp Fri Jul 23 18:35:35 2010 +0800
+++ b/mtpfws/mtpfw/dataproviders/dputility/src/cmtpgetformatcapabilities.cpp Mon Aug 09 12:19:11 2010 +0800
@@ -95,44 +95,71 @@
CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewLC( EMTPFormatCodeAssociation ,interDesc );
//EMTPObjectPropCodeStorageID
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeStorageID) );
+ CMTPTypeObjectPropDesc* storageId = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeStorageID);
+ frmCap->AppendL(storageId);
+ CleanupStack::Pop(storageId);
//EMTPObjectPropCodeObjectFormat
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeObjectFormat) );
+ CMTPTypeObjectPropDesc* objFormat = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeObjectFormat);
+ frmCap->AppendL(objFormat);
+ CleanupStack::Pop(objFormat);
//EMTPObjectPropCodeProtectionStatus
- frmCap->AppendL( ServiceProtectionStatusL() );
+ CMTPTypeObjectPropDesc* protectionStatus = ServiceProtectionStatusL();
+ CleanupStack::PushL(protectionStatus);
+ frmCap->AppendL(protectionStatus);
+ CleanupStack::Pop(protectionStatus);
//EMTPObjectPropCodeAssociationType
- frmCap->AppendL( ServiceAssociationTypeL() );
+ CMTPTypeObjectPropDesc* associationType = ServiceAssociationTypeL();
+ CleanupStack::PushL(associationType);
+ frmCap->AppendL(associationType);
+ CleanupStack::Pop(associationType);
//EMTPObjectPropCodeAssociationDesc
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeAssociationDesc) );
+ CMTPTypeObjectPropDesc* associationDesc = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeAssociationDesc);
+ frmCap->AppendL(associationDesc);
+ CleanupStack::Pop(associationDesc);
//EMTPObjectPropCodeObjectSize
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeObjectSize) );
+ CMTPTypeObjectPropDesc* objSize = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeObjectSize);
+ frmCap->AppendL(objSize);
+ CleanupStack::Pop(objSize);
//EMTPObjectPropCodeObjectFileName
_LIT(KMtpObjDescObjFileName, "[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 7}\\.[[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 2}]?");
- CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName );
- frmCap->AppendL(CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeObjectFileName,
- CMTPTypeObjectPropDesc::ERegularExpressionForm, form));
+ CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName );
+ CMTPTypeObjectPropDesc* objFileName = CMTPTypeObjectPropDesc::NewLC( EMTPObjectPropCodeObjectFileName,
+ CMTPTypeObjectPropDesc::ERegularExpressionForm, form);
+ frmCap->AppendL(objFileName);
+ CleanupStack::Pop(objFileName);
CleanupStack::PopAndDestroy(form );
//EMTPObjectPropCodeDateModified
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeDateModified) );
+ CMTPTypeObjectPropDesc* dateModified = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeDateModified);
+ frmCap->AppendL(dateModified);
+ CleanupStack::Pop(dateModified);
//EMTPObjectPropCodeParentObject
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeParentObject) );
+ CMTPTypeObjectPropDesc* parentobj = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeParentObject);
+ frmCap->AppendL(parentobj);
+ CleanupStack::Pop(parentobj);
//EMTPObjectPropCodePersistentUniqueObjectIdentifier
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodePersistentUniqueObjectIdentifier) );
+ CMTPTypeObjectPropDesc* objectIdentifier = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodePersistentUniqueObjectIdentifier);
+ frmCap->AppendL(objectIdentifier);
+ CleanupStack::Pop(objectIdentifier);
//EMTPObjectPropCodeName
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeName));
+ CMTPTypeObjectPropDesc* name = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeName);
+ frmCap->AppendL(name);
+ CleanupStack::Pop(name);
//EMTPObjectPropCodeNonConsumable
- frmCap->AppendL(ServiceNonConsumableL() );
+ CMTPTypeObjectPropDesc* nonConsumable = ServiceNonConsumableL();
+ CleanupStack::PushL(nonConsumable);
+ frmCap->AppendL(nonConsumable);
+ CleanupStack::Pop(nonConsumable);
iCapabilityList->AppendL(frmCap);
CleanupStack::Pop(frmCap);
@@ -146,38 +173,60 @@
CMTPTypeFormatCapability* frmCap = CMTPTypeFormatCapability::NewLC( aFormatCode ,interDesc );
//EMTPObjectPropCodeStorageID
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeStorageID) );
+ CMTPTypeObjectPropDesc* storageID = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeStorageID);
+ frmCap->AppendL(storageID);
+ CleanupStack::Pop(storageID);
//EMTPObjectPropCodeObjectFormat
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeObjectFormat) );
+ CMTPTypeObjectPropDesc* objectFormat = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeObjectFormat);
+ frmCap->AppendL(objectFormat);
+ CleanupStack::Pop(objectFormat);
//EMTPObjectPropCodeProtectionStatus
- frmCap->AppendL( ServiceProtectionStatusL() );
+ CMTPTypeObjectPropDesc* protectionStatus = ServiceProtectionStatusL();
+ CleanupStack::PushL(protectionStatus);
+ frmCap->AppendL(protectionStatus);
+ CleanupStack::Pop(protectionStatus);
//EMTPObjectPropCodeObjectSize
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeObjectSize) );
+ CMTPTypeObjectPropDesc* objSize = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeObjectSize);
+ frmCap->AppendL(objSize);
+ CleanupStack::Pop(objSize);
//EMTPObjectPropCodeObjectFileName
_LIT(KMtpObjDescObjFileName, "[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 7}\\.[[a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~][a-zA-Z!#\\$%&'\\(\\)\\-0-9@\\^_\\`\\{\\}\\~ ]{0, 2}]?");
- CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName );
- frmCap->AppendL(CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeObjectFileName,
- CMTPTypeObjectPropDesc::ERegularExpressionForm, form));
+ CMTPTypeString* form = CMTPTypeString::NewLC( KMtpObjDescObjFileName );
+ CMTPTypeObjectPropDesc* objFileName = CMTPTypeObjectPropDesc::NewLC( EMTPObjectPropCodeObjectFileName,
+ CMTPTypeObjectPropDesc::ERegularExpressionForm, form);
+ frmCap->AppendL(objFileName);
+ CleanupStack::Pop(objFileName);
CleanupStack::PopAndDestroy(form );
//EMTPObjectPropCodeDateModified
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeDateModified) );
+ CMTPTypeObjectPropDesc* dateModified = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeDateModified);
+ frmCap->AppendL(dateModified);
+ CleanupStack::Pop(dateModified);
//EMTPObjectPropCodeParentObject
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeParentObject) );
+ CMTPTypeObjectPropDesc* parentObject = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeParentObject);
+ frmCap->AppendL(parentObject);
+ CleanupStack::Pop(parentObject);
//EMTPObjectPropCodePersistentUniqueObjectIdentifier
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodePersistentUniqueObjectIdentifier) );
+ CMTPTypeObjectPropDesc* objectIdentifier = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodePersistentUniqueObjectIdentifier);
+ frmCap->AppendL(objectIdentifier);
+ CleanupStack::Pop(objectIdentifier);
//EMTPObjectPropCodeName
- frmCap->AppendL( CMTPTypeObjectPropDesc::NewL(EMTPObjectPropCodeName));
+ CMTPTypeObjectPropDesc* name = CMTPTypeObjectPropDesc::NewLC(EMTPObjectPropCodeName);
+ frmCap->AppendL(name);
+ CleanupStack::Pop(name);
//EMTPObjectPropCodeNonConsumable
- frmCap->AppendL(ServiceNonConsumableL() );
+ CMTPTypeObjectPropDesc* nonConsumable = ServiceNonConsumableL();
+ CleanupStack::PushL(nonConsumable);
+ frmCap->AppendL(nonConsumable);
+ CleanupStack::Pop(nonConsumable);
iCapabilityList->AppendL(frmCap);
CleanupStack::Pop(frmCap);