gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPluginModel.cpp
branchRCL_3
changeset 11 23553eb4e470
parent 0 8c5d936e5675
equal deleted inserted replaced
10:c8b9b0986973 11:23553eb4e470
   147     iStartupConfRepository = CRepository::NewL( KCRUidStartupConf );
   147     iStartupConfRepository = CRepository::NewL( KCRUidStartupConf );
   148     iScreensaverRepository = CRepository::NewL( KCRUidScreenSaver );
   148     iScreensaverRepository = CRepository::NewL( KCRUidScreenSaver );
   149     iPersonalizationRepository =
   149     iPersonalizationRepository =
   150             CRepository::NewL( KCRUidPersonalizationSettings );
   150             CRepository::NewL( KCRUidPersonalizationSettings );
   151     iLightRepository = CRepository::NewL( KCRUidLightSettings );
   151     iLightRepository = CRepository::NewL( KCRUidLightSettings );
       
   152     iSecurityRepository = CRepository::NewL( KCRUidSecuritySettings );
   152     iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
   153     iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
   153     iAvkonRepository = CRepository::NewL( KCRUidAvkon );
   154     iAvkonRepository = CRepository::NewL( KCRUidAvkon );
   154     
   155     
   155     // start listening to CenRep key changes for Operator Logo on/off
   156     // start listening to CenRep key changes for Operator Logo on/off
   156     iNotifyHandlerForOpLogo = CCenRepNotifyHandler::NewL( *this, 
   157     iNotifyHandlerForOpLogo = CCenRepNotifyHandler::NewL( *this, 
   211     if ( iAvkonRepository )
   212     if ( iAvkonRepository )
   212         {
   213         {
   213         delete iAvkonRepository;
   214         delete iAvkonRepository;
   214         iAvkonRepository = NULL;
   215         iAvkonRepository = NULL;
   215         }
   216         }
       
   217     delete iSecurityRepository;
       
   218     iSecurityRepository = NULL;
   216     }
   219     }
   217 
   220 
   218 
   221 
   219 // ----------------------------------------------------------------------------
   222 // ----------------------------------------------------------------------------
   220 // CGSDisplayPluginModel::WelcomeNoteTypeL
   223 // CGSDisplayPluginModel::WelcomeNoteTypeL
   361                                                      aText ) );
   364                                                      aText ) );
   362     }
   365     }
   363 
   366 
   364 
   367 
   365 // ----------------------------------------------------------------------------
   368 // ----------------------------------------------------------------------------
   366 // CGSDisplayPluginModel::ScreenSaverPeriodL
   369 // CGSDisplayPluginModel::ScreenSaverAndKeyguardPeriodL
   367 //
   370 //
   368 // Reads screen saver period from shared data and returns it.
   371 // Reads screen saver period from shared data and returns it.
   369 // ----------------------------------------------------------------------------
   372 // ----------------------------------------------------------------------------
   370 //
   373 //
   371 TInt CGSDisplayPluginModel::ScreenSaverPeriodL()
   374 TInt CGSDisplayPluginModel::ScreenSaverAndKeyguardPeriodL()
   372     {
   375     {
   373     TInt period = KGSSettingOff;
   376     TInt period = KGSSettingOff;
   374     User::LeaveIfError( iPersonalizationRepository->
   377     User::LeaveIfError( iSecurityRepository->
   375             Get( KSettingsScreenSaverPeriod, period ) );
   378             Get( KSettingsAutomaticKeyguardTime, period ) );
   376 
   379 
   377     return period;
   380     // period is stored in seconds, but the user setting is in minutes
   378     }
   381     return period / 60;
   379 
   382     }
   380 // ----------------------------------------------------------------------------
   383 
   381 // CGSDisplayPluginModel::SetScreenSaverPeriodL
   384 // ----------------------------------------------------------------------------
       
   385 // CGSDisplayPluginModel::SetScreenSaverAndKeyguardPeriodL
   382 //
   386 //
   383 // Writes screen saver text to shared data.
   387 // Writes screen saver text to shared data.
   384 // ----------------------------------------------------------------------------
   388 // ----------------------------------------------------------------------------
   385 //
   389 //
   386 void CGSDisplayPluginModel::SetScreenSaverPeriodL( const TInt aPeriod )
   390 void CGSDisplayPluginModel::SetScreenSaverAndKeyguardPeriodL( const TInt aPeriod )
   387     {
   391     {
   388     User::LeaveIfError( iPersonalizationRepository->
   392     // value is in minutes but keyguard uses seconds
   389             Set( KSettingsScreenSaverPeriod, aPeriod ) );
   393     User::LeaveIfError( iSecurityRepository->
       
   394             Set( KSettingsAutomaticKeyguardTime, aPeriod * 60 ) );
   390     }
   395     }
   391 
   396 
   392 
   397 
   393 // ----------------------------------------------------------------------------
   398 // ----------------------------------------------------------------------------
   394 // CGSDisplayPluginModel::BacklightPeriodL
   399 // CGSDisplayPluginModel::BacklightPeriodL