611 parameters[3] = invalidParameterIndex; |
611 parameters[3] = invalidParameterIndex; |
612 SendResponseL(responseCode, 4, parameters); |
612 SendResponseL(responseCode, 4, parameters); |
613 } |
613 } |
614 } |
614 } |
615 |
615 |
616 if (result) |
616 if (result && !iIsFolder) |
617 { |
617 { |
618 result = !Exists(iFullPath); |
618 result = !Exists(iFullPath); |
619 if (!result) |
619 if (!result) |
620 { |
620 { |
621 // Object with the same name already exists. |
621 // Object with the same name already exists. |
1098 { |
1098 { |
1099 __FLOG(_L8("ReserveObjectL - Entry")); |
1099 __FLOG(_L8("ReserveObjectL - Entry")); |
1100 iReceivedObject->SetUint(CMTPObjectMetaData::EStorageId, iStorageId); |
1100 iReceivedObject->SetUint(CMTPObjectMetaData::EStorageId, iStorageId); |
1101 iReceivedObject->SetDesCL(CMTPObjectMetaData::ESuid, iFullPath); |
1101 iReceivedObject->SetDesCL(CMTPObjectMetaData::ESuid, iFullPath); |
1102 |
1102 |
1103 iFramework.ObjectMgr().ReserveObjectHandleL(*iReceivedObject, iObjectSize); |
|
1104 |
|
1105 if(iIsFolder) |
1103 if(iIsFolder) |
1106 { |
1104 { |
1107 SetPropertiesL(); |
1105 SetPropertiesL(); |
1108 iFramework.ObjectMgr().CommitReservedObjectHandleL(*iReceivedObject); |
1106 TUint32 handle = iFramework.ObjectMgr().HandleL(iFullPath); |
|
1107 if (handle != KMTPHandleNone) |
|
1108 { |
|
1109 // The folder is already in DB |
|
1110 iReceivedObject->SetUint(CMTPObjectMetaData::EHandle, handle); |
|
1111 iFramework.ObjectMgr().ModifyObjectL(*iReceivedObject); |
|
1112 } |
|
1113 else |
|
1114 { |
|
1115 iFramework.ObjectMgr().ReserveObjectHandleL(*iReceivedObject, iObjectSize); |
|
1116 iFramework.ObjectMgr().CommitReservedObjectHandleL(*iReceivedObject); |
|
1117 } |
1109 } |
1118 } |
1110 else |
1119 else |
1111 { |
1120 { |
1112 iExpectedSendObjectRequest.SetUint32(TMTPTypeRequest::ERequestSessionID, iSessionId); |
1121 iFramework.ObjectMgr().ReserveObjectHandleL(*iReceivedObject, iObjectSize); |
1113 iFramework.RouteRequestRegisterL(iExpectedSendObjectRequest, iConnection); |
1122 iExpectedSendObjectRequest.SetUint32(TMTPTypeRequest::ERequestSessionID, iSessionId); |
1114 } |
1123 iFramework.RouteRequestRegisterL(iExpectedSendObjectRequest, iConnection); |
|
1124 } |
1115 TUint32 parameters[3]; |
1125 TUint32 parameters[3]; |
1116 parameters[0] = iStorageId; |
1126 parameters[0] = iStorageId; |
1117 parameters[1] = iParentHandle; |
1127 parameters[1] = iParentHandle; |
1118 parameters[2] = iReceivedObject->Uint(CMTPObjectMetaData::EHandle); |
1128 parameters[2] = iReceivedObject->Uint(CMTPObjectMetaData::EHandle); |
1119 SendResponseL(EMTPRespCodeOK, (sizeof(parameters) / sizeof(parameters[0])), parameters); |
1129 SendResponseL(EMTPRespCodeOK, (sizeof(parameters) / sizeof(parameters[0])), parameters); |