profilesservices/ProfileEngine/EngSrc/CProfileEngineImpl.cpp
changeset 63 cae55c3d1f20
parent 59 4868a89ec1e3
equal deleted inserted replaced
59:4868a89ec1e3 63:cae55c3d1f20
  1239 // -----------------------------------------------------------------------------
  1239 // -----------------------------------------------------------------------------
  1240 //
  1240 //
  1241 void CProfileEngineImpl::SetSilenceModeL( TBool aSilenceMode )
  1241 void CProfileEngineImpl::SetSilenceModeL( TBool aSilenceMode )
  1242     {
  1242     {
  1243     User::LeaveIfError( iCenRep->Set( KProEngSilenceMode, aSilenceMode ? 1 : 0 ) );
  1243     User::LeaveIfError( iCenRep->Set( KProEngSilenceMode, aSilenceMode ? 1 : 0 ) );
  1244     //Also set profiles' ring type to silence
  1244     
  1245     TInt countOfProfiles = iProfileLocalisedNames->MdcaCount();
  1245     //Send event through P&S
  1246     
  1246     CreatePubSubKeysIfNeededL();
  1247     for (TInt i = 0; i < countOfProfiles; ++i) 
  1247     PublishChangeL( KProEngActiveProfileModified );
  1248         {
       
  1249         const MProfileName* profileName = iProfileLocalisedNames->ProfileName(i);
       
  1250         if (profileName) 
       
  1251             {
       
  1252             MProfileExtended2* profile = Profile2LC(profileName->Id());      
       
  1253             TProfileToneSettings setToneSettings = profile->ProfileSetTones().SetToneSettings();
       
  1254             setToneSettings.iRingingType = aSilenceMode ? EProfileRingingTypeSilent : EProfileRingingTypeRinging;
       
  1255             CommitChange2L(*profile);
       
  1256             CleanupStack::PopAndDestroy();
       
  1257             }
       
  1258         
       
  1259         }
       
  1260     }
  1248     }
  1261 
  1249 
  1262 //  End of File
  1250 //  End of File