96 @param aConnection The connection from which the request comes |
96 @param aConnection The connection from which the request comes |
97 */ |
97 */ |
98 CMTPImageDpSendObjectInfo::CMTPImageDpSendObjectInfo(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPImageDataProvider& aDataProvider) : |
98 CMTPImageDpSendObjectInfo::CMTPImageDpSendObjectInfo(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection, CMTPImageDataProvider& aDataProvider) : |
99 CMTPRequestProcessor(aFramework, aConnection, 0, NULL), |
99 CMTPRequestProcessor(aFramework, aConnection, 0, NULL), |
100 iDataProvider(aDataProvider), |
100 iDataProvider(aDataProvider), |
101 iHiddenStatus( EMTPVisible ), |
|
102 iObjectPropertyMgr(aDataProvider.PropertyMgr()) |
101 iObjectPropertyMgr(aDataProvider.PropertyMgr()) |
103 { |
102 { |
104 |
103 |
105 } |
104 } |
106 |
105 |
784 iFramework.RouteRequestUnregisterL(iExpectedSendObjectRequest, iConnection); |
783 iFramework.RouteRequestUnregisterL(iExpectedSendObjectRequest, iConnection); |
785 Rollback(); |
784 Rollback(); |
786 SendResponseL(EMTPRespCodeTransactionCancelled); |
785 SendResponseL(EMTPRespCodeTransactionCancelled); |
787 } |
786 } |
788 else if (result && !iCancelled) |
787 else if (result && !iCancelled) |
789 { |
788 { |
790 TUint attValue = 0; |
|
791 User::LeaveIfError(iFileReceived->File().Att(attValue)); |
|
792 if (iProtectionStatus == EMTPProtectionNoProtection || |
789 if (iProtectionStatus == EMTPProtectionNoProtection || |
793 iProtectionStatus == EMTPProtectionReadOnly) |
790 iProtectionStatus == EMTPProtectionReadOnly) |
794 { |
791 { |
|
792 TUint attValue = 0; |
|
793 User::LeaveIfError(iFileReceived->File().Att(attValue)); |
795 attValue &= ~(KEntryAttNormal | KEntryAttReadOnly); |
794 attValue &= ~(KEntryAttNormal | KEntryAttReadOnly); |
796 |
795 |
797 if (iProtectionStatus == EMTPProtectionNoProtection) |
796 if (iProtectionStatus == EMTPProtectionNoProtection) |
798 { |
797 { |
799 attValue |= KEntryAttNormal; |
798 attValue |= KEntryAttNormal; |
800 } |
799 } |
801 else |
800 else |
802 { |
801 { |
803 attValue |= KEntryAttReadOnly; |
802 attValue |= KEntryAttReadOnly; |
804 } |
803 } |
805 User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue)); |
|
806 } |
|
807 if ( iHiddenStatus == EMTPHidden ) |
|
808 { |
|
809 attValue &= ~KEntryAttHidden; |
|
810 attValue |= KEntryAttHidden; |
|
811 User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue)); |
804 User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue)); |
812 } |
805 } |
813 TTime modifiedTime; |
806 TTime modifiedTime; |
814 //update datemodified property. |
807 //update datemodified property. |
815 if(iDateMod != NULL && iDateMod->Length()) |
808 if(iDateMod != NULL && iDateMod->Length()) |
1067 break; |
1060 break; |
1068 |
1061 |
1069 case EMTPObjectPropCodeNonConsumable: |
1062 case EMTPObjectPropCodeNonConsumable: |
1070 iNonConsumable = aElement.Uint8L(CMTPTypeObjectPropListElement::EValue); |
1063 iNonConsumable = aElement.Uint8L(CMTPTypeObjectPropListElement::EValue); |
1071 break; |
1064 break; |
1072 case EMTPObjectPropCodeHidden: |
1065 |
1073 iHiddenStatus = aElement.Uint16L(CMTPTypeObjectPropListElement::EValue); |
|
1074 break; |
|
1075 default: |
1066 default: |
1076 break; |
1067 break; |
1077 } |
1068 } |
1078 __FLOG_VA((_L8("Result = 0x%04X"), responseCode)); |
1069 __FLOG_VA((_L8("Result = 0x%04X"), responseCode)); |
1079 __FLOG(_L8("CMTPImageDpSendObjectInfo::ExtractPropertyL - Exit")); |
1070 __FLOG(_L8("CMTPImageDpSendObjectInfo::ExtractPropertyL - Exit")); |
1140 responseCode = EMTPRespCodeAccessDenied; |
1131 responseCode = EMTPRespCodeAccessDenied; |
1141 break; |
1132 break; |
1142 |
1133 |
1143 case EMTPObjectPropCodeRepresentativeSampleFormat: |
1134 case EMTPObjectPropCodeRepresentativeSampleFormat: |
1144 case EMTPObjectPropCodeProtectionStatus: |
1135 case EMTPObjectPropCodeProtectionStatus: |
1145 case EMTPObjectPropCodeHidden: |
|
1146 if (aElement.Uint16L(CMTPTypeObjectPropListElement::EDatatype) != EMTPTypeUINT16) |
1136 if (aElement.Uint16L(CMTPTypeObjectPropListElement::EDatatype) != EMTPTypeUINT16) |
1147 { |
1137 { |
1148 responseCode = EMTPRespCodeInvalidObjectPropFormat; |
1138 responseCode = EMTPRespCodeInvalidObjectPropFormat; |
1149 } |
1139 } |
1150 break; |
1140 break; |