mtpdataproviders/mtpimagedp/src/cmtpimagedpobjectpropertymgr.cpp
branchRCL_3
changeset 48 debf68073f2f
parent 45 74aa6861c87d
child 58 142dacf7b30e
equal deleted inserted replaced
45:74aa6861c87d 48:debf68073f2f
   275         iObjectInfo->SetUint(CMTPObjectMetaData::EFormatCode, aValue);
   275         iObjectInfo->SetUint(CMTPObjectMetaData::EFormatCode, aValue);
   276         break;        
   276         break;        
   277     case EMTPObjectPropCodeProtectionStatus://this property does not supported by image dp
   277     case EMTPObjectPropCodeProtectionStatus://this property does not supported by image dp
   278         //nothing to do
   278         //nothing to do
   279         break;
   279         break;
       
   280     case EMTPObjectPropCodeHidden:
       
   281         {
       
   282 		__ASSERT_ALWAYS(( EMTPHidden == aValue )||( EMTPVisible == aValue ), User::Leave(KErrArgument));
       
   283         TEntry entry;
       
   284 		User::LeaveIfError(iFramework.Fs().Entry(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), entry));
       
   285         if (( EMTPHidden == aValue ) && ( !entry.IsHidden()))
       
   286             {
       
   287             entry.iAtt &= ~KEntryAttHidden;
       
   288             entry.iAtt |= KEntryAttHidden;
       
   289             User::LeaveIfError(iFramework.Fs().SetAtt(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), entry.iAtt, ~entry.iAtt));
       
   290             }
       
   291         else if (( EMTPVisible == aValue )&&( entry.IsHidden()))
       
   292             {
       
   293             entry.iAtt &= ~KEntryAttHidden;
       
   294             User::LeaveIfError(iFramework.Fs().SetAtt(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), entry.iAtt, ~entry.iAtt));
       
   295             }
       
   296         } 
       
   297         break;
   280     default:
   298     default:
   281         //nothing to do
   299         //nothing to do
   282         break;
   300         break;
   283         }
   301         }
   284     __FLOG(_L8("<< CMTPImageDpObjectPropertyMgr::SetPropertyL"));
   302     __FLOG(_L8("<< CMTPImageDpObjectPropertyMgr::SetPropertyL"));
   418         else
   436         else
   419             {
   437             {
   420             aValue = EMTPProtectionNoProtection;
   438             aValue = EMTPProtectionNoProtection;
   421             }        
   439             }        
   422         }    
   440         }    
   423         break;    
   441         break;
       
   442     case EMTPObjectPropCodeHidden:
       
   443         {
       
   444         TInt err = iFs.Entry(iObjectInfo->DesC(CMTPObjectMetaData::ESuid), entry);        
       
   445         if ( err == KErrNone && entry.IsHidden())
       
   446             {
       
   447             aValue = EMTPHidden;
       
   448             }
       
   449         else
       
   450             {
       
   451             aValue = EMTPVisible;
       
   452             }        
       
   453         } 
       
   454         break;
   424     default:
   455     default:
   425         aValue = 0;//initialization
   456         aValue = 0;//initialization
   426         //ingore the failure if we can't get properties form MdS
   457         //ingore the failure if we can't get properties form MdS
   427         TRAP_IGNORE(GetPropertyFromMdsL(aProperty, &aValue));
   458         TRAP_IGNORE(GetPropertyFromMdsL(aProperty, &aValue));
   428         break;
   459         break;