mtpdataproviders/mtpimagedp/src/cmtpimagedpsendobjectinfo.cpp
branchRCL_3
changeset 48 debf68073f2f
parent 43 4a793f564d72
child 58 142dacf7b30e
equal deleted inserted replaced
45:74aa6861c87d 48:debf68073f2f
    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 ),
   101     iObjectPropertyMgr(aDataProvider.PropertyMgr())
   102     iObjectPropertyMgr(aDataProvider.PropertyMgr())
   102     {
   103     {
   103 
   104 
   104     }
   105     }
   105 
   106 
   783         iFramework.RouteRequestUnregisterL(iExpectedSendObjectRequest, iConnection);
   784         iFramework.RouteRequestUnregisterL(iExpectedSendObjectRequest, iConnection);
   784         Rollback();
   785         Rollback();
   785         SendResponseL(EMTPRespCodeTransactionCancelled);    
   786         SendResponseL(EMTPRespCodeTransactionCancelled);    
   786         }
   787         }
   787     else if (result && !iCancelled)
   788     else if (result && !iCancelled)
   788 	    {	    	    
   789 	    {
       
   790         TUint attValue = 0;
       
   791         User::LeaveIfError(iFileReceived->File().Att(attValue));
   789         if (iProtectionStatus ==  EMTPProtectionNoProtection ||
   792         if (iProtectionStatus ==  EMTPProtectionNoProtection ||
   790             iProtectionStatus == EMTPProtectionReadOnly)
   793             iProtectionStatus == EMTPProtectionReadOnly)
   791             {
   794             {
   792             TUint attValue = 0;
       
   793             User::LeaveIfError(iFileReceived->File().Att(attValue));
       
   794             attValue &= ~(KEntryAttNormal | KEntryAttReadOnly);
   795             attValue &= ~(KEntryAttNormal | KEntryAttReadOnly);
   795             
   796             
   796             if (iProtectionStatus == EMTPProtectionNoProtection)
   797             if (iProtectionStatus == EMTPProtectionNoProtection)
   797                 {                        
   798                 {                        
   798                 attValue |= KEntryAttNormal;
   799                 attValue |= KEntryAttNormal;
   799                 }
   800                 }
   800             else
   801             else
   801                 {
   802                 {
   802                 attValue |= KEntryAttReadOnly;
   803                 attValue |= KEntryAttReadOnly;
   803                 }
   804                 }
       
   805             User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue));
       
   806             }
       
   807         if ( iHiddenStatus == EMTPHidden )
       
   808             {
       
   809             attValue &= ~KEntryAttHidden;
       
   810             attValue |= KEntryAttHidden;
   804             User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue));
   811             User::LeaveIfError(iFileReceived->File().SetAtt(attValue, ~attValue));
   805             }
   812             }
   806         TTime modifiedTime;
   813         TTime modifiedTime;
   807         //update datemodified property.
   814         //update datemodified property.
   808         if(iDateMod != NULL && iDateMod->Length())
   815         if(iDateMod != NULL && iDateMod->Length())
  1060         break;
  1067         break;
  1061         
  1068         
  1062     case EMTPObjectPropCodeNonConsumable:
  1069     case EMTPObjectPropCodeNonConsumable:
  1063         iNonConsumable = aElement.Uint8L(CMTPTypeObjectPropListElement::EValue);       
  1070         iNonConsumable = aElement.Uint8L(CMTPTypeObjectPropListElement::EValue);       
  1064         break;
  1071         break;
  1065         
  1072     case EMTPObjectPropCodeHidden:
       
  1073         iHiddenStatus = aElement.Uint16L(CMTPTypeObjectPropListElement::EValue);
       
  1074         break;    
  1066     default:
  1075     default:
  1067         break;
  1076         break;
  1068         }
  1077         }
  1069     __FLOG_VA((_L8("Result = 0x%04X"), responseCode));
  1078     __FLOG_VA((_L8("Result = 0x%04X"), responseCode));
  1070     __FLOG(_L8("CMTPImageDpSendObjectInfo::ExtractPropertyL - Exit"));
  1079     __FLOG(_L8("CMTPImageDpSendObjectInfo::ExtractPropertyL - Exit"));
  1131         responseCode =     EMTPRespCodeAccessDenied;
  1140         responseCode =     EMTPRespCodeAccessDenied;
  1132         break;
  1141         break;
  1133 
  1142 
  1134     case EMTPObjectPropCodeRepresentativeSampleFormat:
  1143     case EMTPObjectPropCodeRepresentativeSampleFormat:
  1135     case EMTPObjectPropCodeProtectionStatus:
  1144     case EMTPObjectPropCodeProtectionStatus:
       
  1145     case EMTPObjectPropCodeHidden:
  1136         if (aElement.Uint16L(CMTPTypeObjectPropListElement::EDatatype) != EMTPTypeUINT16)
  1146         if (aElement.Uint16L(CMTPTypeObjectPropListElement::EDatatype) != EMTPTypeUINT16)
  1137             {
  1147             {
  1138             responseCode = EMTPRespCodeInvalidObjectPropFormat;
  1148             responseCode = EMTPRespCodeInvalidObjectPropFormat;
  1139             }                        
  1149             }                        
  1140         break;
  1150         break;