82 { |
82 { |
83 TRACER("CShwSlideshowBackLightTimer::ConstructL"); |
83 TRACER("CShwSlideshowBackLightTimer::ConstructL"); |
84 GLX_LOG_ENTRY_EXIT("CShwSlideshowBackLightTimer::ConstructL"); |
84 GLX_LOG_ENTRY_EXIT("CShwSlideshowBackLightTimer::ConstructL"); |
85 |
85 |
86 CRepository* lightsRepo = CRepository::NewLC( KCRUidPeripheralSettings ); |
86 CRepository* lightsRepo = CRepository::NewLC( KCRUidPeripheralSettings ); |
87 // What's the timeout value (in seconds ) for the display light? |
87 // Get display light's timeout value (in seconds ) |
88 lightsRepo->Get( KSettingsDisplayLightsTimeout, iSettingsDelay ); |
88 lightsRepo->Get( KSettingsDisplayLightsTimeout, iSettingsDelay ); |
89 GLX_LOG_INFO1("CShwSlideshowBackLightTimer, lights timeout = %d", |
89 GLX_LOG_INFO1("CShwSlideshowBackLightTimer, lights timeout = %d", |
90 iSettingsDelay ); |
90 iSettingsDelay ); |
91 CleanupStack::PopAndDestroy( lightsRepo ); |
91 CleanupStack::PopAndDestroy( lightsRepo ); |
92 |
92 |
93 CRepository* scrSaverRepo = CRepository::NewLC( KCRUidPersonalizationSettings ); |
93 CRepository* scrSaverRepo = CRepository::NewLC( KCRUidPersonalizationSettings ); |
94 // What's the screen saver's timeout value (in seconds)? |
94 // Get screen saver's timeout value (in seconds) |
95 TInt screenSaverTimeout = 0; |
95 TInt screenSaverTimeout = 0; |
96 scrSaverRepo->Get( KSettingsScreenSaverPeriod, screenSaverTimeout ); |
96 scrSaverRepo->Get( KSettingsScreenSaverPeriod, screenSaverTimeout ); |
97 GLX_LOG_INFO1("CShwSlideshowBackLightTimer, scr saver timeout = %d", |
97 GLX_LOG_INFO1("CShwSlideshowBackLightTimer, scr saver timeout = %d", |
98 screenSaverTimeout ); |
98 screenSaverTimeout ); |
99 CleanupStack::PopAndDestroy( scrSaverRepo ); |
99 CleanupStack::PopAndDestroy( scrSaverRepo ); |
100 |
100 |
101 // Take the smaller of the two timeout values |
101 // Take the smaller of the two timeout values |
102 iSettingsDelay = Min( iSettingsDelay, screenSaverTimeout ); |
102 iSettingsDelay = Min( iSettingsDelay, screenSaverTimeout ); |
103 |
103 |
104 // Set the timeout delay to minimum value as it can not be zero! |
104 // Set the timeout delay to minimum value as it can not be zero |
105 if (iSettingsDelay == 0) |
105 if (iSettingsDelay == 0) |
106 { |
106 { |
107 iSettingsDelay = KMinTimeoutDelay; |
107 iSettingsDelay = KMinTimeoutDelay; |
108 } |
108 } |
109 |
109 |