author | ar <ar> | 2004-05-02 16:35:53 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-02 16:35:53 (UTC) |
commit | f8add41b2e0b0371754521b44d95f87fa70a6ff2 (patch) (unidiff) | |
tree | 5e31a4f036ff20fc3a5961e99a17fc141caf9b8b /core/launcher/screensaver.cpp | |
parent | 34f1234b010fa80f9ca06e65f46130713f7362d9 (diff) | |
download | opie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.zip opie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.tar.gz opie-f8add41b2e0b0371754521b44d95f87fa70a6ff2.tar.bz2 |
- convert qDebug to odebug
Diffstat (limited to 'core/launcher/screensaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/screensaver.cpp | 386 |
1 files changed, 195 insertions, 191 deletions
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index a7d23c4..f818d62 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <qpe/network.h> | 5 | #include <qpe/network.h> |
6 | 6 | ||
7 | #include <opie2/odevice.h> | 7 | #include <opie2/odevice.h> |
8 | #include <opie2/odebug.h> | ||
8 | 9 | ||
9 | 10 | ||
10 | using namespace Opie::Core; | 11 | using namespace Opie::Core; |
@@ -12,36 +13,36 @@ using namespace Opie::Core; | |||
12 | 13 | ||
13 | 14 | ||
14 | OpieScreenSaver::OpieScreenSaver ( ) | 15 | OpieScreenSaver::OpieScreenSaver ( ) |
15 | : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) | 16 | : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) |
16 | { | 17 | { |
17 | m_disable_suspend = 100; | 18 | m_disable_suspend = 100; |
18 | m_enable_dim = false; | 19 | m_enable_dim = false; |
19 | m_enable_lightoff = false; | 20 | m_enable_lightoff = false; |
20 | m_enable_suspend = false; | 21 | m_enable_suspend = false; |
21 | m_onlylcdoff = false; | 22 | m_onlylcdoff = false; |
22 | 23 | ||
23 | m_enable_dim_ac = false; | 24 | m_enable_dim_ac = false; |
24 | m_enable_lightoff_ac = false; | 25 | m_enable_lightoff_ac = false; |
25 | m_enable_suspend_ac = false; | 26 | m_enable_suspend_ac = false; |
26 | m_onlylcdoff_ac = false; | 27 | m_onlylcdoff_ac = false; |
27 | 28 | ||
28 | m_use_light_sensor = false; | 29 | m_use_light_sensor = false; |
29 | m_backlight_sensor = -1; | 30 | m_backlight_sensor = -1; |
30 | ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] )); | 31 | ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] )); |
31 | 32 | ||
32 | m_lcd_status = true; | 33 | m_lcd_status = true; |
33 | 34 | ||
34 | m_backlight_normal = -1; | 35 | m_backlight_normal = -1; |
35 | m_backlight_current = -1; | 36 | m_backlight_current = -1; |
36 | m_backlight_forcedoff = false; | 37 | m_backlight_forcedoff = false; |
37 | 38 | ||
38 | m_on_ac = false; | 39 | m_on_ac = false; |
39 | 40 | ||
40 | m_level = -1; | 41 | m_level = -1; |
41 | 42 | ||
42 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) | 43 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) |
43 | ODevice::inst ( )-> setDisplayStatus ( true ); | 44 | ODevice::inst ( )-> setDisplayStatus ( true ); |
44 | setBacklight ( -1 ); | 45 | setBacklight ( -1 ); |
45 | } | 46 | } |
46 | 47 | ||
47 | 48 | ||
@@ -50,14 +51,14 @@ OpieScreenSaver::OpieScreenSaver ( ) | |||
50 | */ | 51 | */ |
51 | void OpieScreenSaver::restore() | 52 | void OpieScreenSaver::restore() |
52 | { | 53 | { |
53 | m_level = -1; | 54 | m_level = -1; |
54 | 55 | ||
55 | if ( !m_lcd_status ) { // We must have turned it off | 56 | if ( !m_lcd_status ) { // We must have turned it off |
56 | ODevice::inst ( ) -> setDisplayStatus ( true ); | 57 | ODevice::inst ( ) -> setDisplayStatus ( true ); |
57 | m_lcd_status = true; | 58 | m_lcd_status = true; |
58 | } | 59 | } |
59 | 60 | ||
60 | setBacklightInternal ( -1 ); | 61 | setBacklightInternal ( -1 ); |
61 | } | 62 | } |
62 | 63 | ||
63 | 64 | ||
@@ -70,52 +71,52 @@ void OpieScreenSaver::restore() | |||
70 | */ | 71 | */ |
71 | bool OpieScreenSaver::save( int level ) | 72 | bool OpieScreenSaver::save( int level ) |
72 | { | 73 | { |
73 | m_level = level; | 74 | m_level = level; |
74 | 75 | ||
75 | switch ( level ) { | 76 | switch ( level ) { |
76 | case 0: | 77 | case 0: |
77 | if (( m_on_ac && m_enable_dim_ac ) || | 78 | if (( m_on_ac && m_enable_dim_ac ) || |
78 | ( !m_on_ac && m_enable_dim )) { | 79 | ( !m_on_ac && m_enable_dim )) { |
79 | if (( m_disable_suspend > 0 ) && ( m_backlight_current > 1 ) && !m_use_light_sensor ) | 80 | if (( m_disable_suspend > 0 ) && ( m_backlight_current > 1 ) && !m_use_light_sensor ) |
80 | setBacklightInternal ( 1 ); // lowest non-off | 81 | setBacklightInternal ( 1 ); // lowest non-off |
81 | } | 82 | } |
82 | return true; | 83 | return true; |
83 | break; | 84 | break; |
84 | 85 | ||
85 | case 1: | 86 | case 1: |
86 | if (( m_on_ac && m_enable_lightoff_ac ) || | 87 | if (( m_on_ac && m_enable_lightoff_ac ) || |
87 | ( !m_on_ac && m_enable_lightoff )) { | 88 | ( !m_on_ac && m_enable_lightoff )) { |
88 | if ( m_disable_suspend > 1 ) | 89 | if ( m_disable_suspend > 1 ) |
89 | setBacklightInternal ( 0 ); // off | 90 | setBacklightInternal ( 0 ); // off |
90 | } | 91 | } |
91 | return true; | 92 | return true; |
92 | break; | 93 | break; |
93 | 94 | ||
94 | case 2: | 95 | case 2: |
95 | if (( m_on_ac && !m_enable_suspend_ac ) || | 96 | if (( m_on_ac && !m_enable_suspend_ac ) || |
96 | ( !m_on_ac && !m_enable_suspend )) { | 97 | ( !m_on_ac && !m_enable_suspend )) { |
97 | return true; | 98 | return true; |
98 | } | 99 | } |
99 | 100 | ||
100 | if (( m_on_ac && m_onlylcdoff_ac ) || | 101 | if (( m_on_ac && m_onlylcdoff_ac ) || |
101 | ( !m_on_ac && m_onlylcdoff )) { | 102 | ( !m_on_ac && m_onlylcdoff )) { |
102 | ODevice::inst ( ) -> setDisplayStatus ( false ); | 103 | ODevice::inst ( ) -> setDisplayStatus ( false ); |
103 | m_lcd_status = false; | 104 | m_lcd_status = false; |
104 | return true; | 105 | return true; |
105 | } | 106 | } |
106 | 107 | ||
107 | // We're going to suspend the whole machine | 108 | // We're going to suspend the whole machine |
108 | 109 | ||
109 | if (( m_disable_suspend > 2 ) && !Network::networkOnline ( )) { | 110 | if (( m_disable_suspend > 2 ) && !Network::networkOnline ( )) { |
110 | // TODO: why is this key F34 hard coded? -- schurig | 111 | // TODO: why is this key F34 hard coded? -- schurig |
111 | // Does this now only work an devices with a ODevice::filter? | 112 | // Does this now only work an devices with a ODevice::filter? |
112 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | 113 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); |
113 | return true; | 114 | return true; |
114 | } | 115 | } |
115 | 116 | ||
116 | break; | 117 | break; |
117 | } | 118 | } |
118 | return false; | 119 | return false; |
119 | } | 120 | } |
120 | 121 | ||
121 | 122 | ||
@@ -134,41 +135,41 @@ bool OpieScreenSaver::save( int level ) | |||
134 | */ | 135 | */ |
135 | void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend ) | 136 | void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend ) |
136 | { | 137 | { |
137 | Config config ( "apm" ); | 138 | Config config ( "apm" ); |
138 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); | 139 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); |
139 | 140 | ||
140 | int v[ 4 ]; | 141 | int v[ 4 ]; |
141 | if ( dim < 0 ) | 142 | if ( dim < 0 ) |
142 | dim = config. readNumEntry ( "Dim", m_on_ac ? 60 : 30 ); | 143 | dim = config. readNumEntry ( "Dim", m_on_ac ? 60 : 30 ); |
143 | if ( lightoff < 0 ) | 144 | if ( lightoff < 0 ) |
144 | lightoff = config. readNumEntry ( "LightOff", m_on_ac ? 120 : 20 ); | 145 | lightoff = config. readNumEntry ( "LightOff", m_on_ac ? 120 : 20 ); |
145 | if ( suspend < 0 ) | 146 | if ( suspend < 0 ) |
146 | suspend = config. readNumEntry ( "Suspend", m_on_ac ? 0 : 60 ); | 147 | suspend = config. readNumEntry ( "Suspend", m_on_ac ? 0 : 60 ); |
147 | 148 | ||
148 | if ( m_on_ac ) { | 149 | if ( m_on_ac ) { |
149 | m_enable_dim_ac = ( dim > 0 ); | 150 | m_enable_dim_ac = ( dim > 0 ); |
150 | m_enable_lightoff_ac = ( lightoff > 0 ); | 151 | m_enable_lightoff_ac = ( lightoff > 0 ); |
151 | m_enable_suspend_ac = ( suspend > 0 ); | 152 | m_enable_suspend_ac = ( suspend > 0 ); |
152 | m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false ); | 153 | m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false ); |
153 | } | 154 | } |
154 | else { | 155 | else { |
155 | m_enable_dim = ( dim > 0 ); | 156 | m_enable_dim = ( dim > 0 ); |
156 | m_enable_lightoff = ( lightoff > 0 ); | 157 | m_enable_lightoff = ( lightoff > 0 ); |
157 | m_enable_suspend = ( suspend > 0 ); | 158 | m_enable_suspend = ( suspend > 0 ); |
158 | m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); | 159 | m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); |
159 | } | 160 | } |
160 | 161 | ||
161 | //odebug << "screen saver intervals: " << dim << " " << lightoff << " " << suspend << "" << oendl; | 162 | //odebug << "screen saver intervals: " << dim << " " << lightoff << " " << suspend << "" << oendl; |
162 | 163 | ||
163 | v [ 0 ] = QMAX( 1000 * dim, 100 ); | 164 | v [ 0 ] = QMAX( 1000 * dim, 100 ); |
164 | v [ 1 ] = QMAX( 1000 * lightoff, 100 ); | 165 | v [ 1 ] = QMAX( 1000 * lightoff, 100 ); |
165 | v [ 2 ] = QMAX( 1000 * suspend, 100 ); | 166 | v [ 2 ] = QMAX( 1000 * suspend, 100 ); |
166 | v [ 3 ] = 0; | 167 | v [ 3 ] = 0; |
167 | 168 | ||
168 | if ( !dim && !lightoff && !suspend ) | 169 | if ( !dim && !lightoff && !suspend ) |
169 | QWSServer::setScreenSaverInterval( 0 ); | 170 | QWSServer::setScreenSaverInterval( 0 ); |
170 | else | 171 | else |
171 | QWSServer::setScreenSaverIntervals( v ); | 172 | QWSServer::setScreenSaverIntervals( v ); |
172 | } | 173 | } |
173 | 174 | ||
174 | 175 | ||
@@ -180,15 +181,15 @@ void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend ) | |||
180 | */ | 181 | */ |
181 | void OpieScreenSaver::setInterval ( int interval ) | 182 | void OpieScreenSaver::setInterval ( int interval ) |
182 | { | 183 | { |
183 | setIntervals ( -1, -1, interval ); | 184 | setIntervals ( -1, -1, interval ); |
184 | } | 185 | } |
185 | 186 | ||
186 | 187 | ||
187 | void OpieScreenSaver::setMode ( int mode ) | 188 | void OpieScreenSaver::setMode ( int mode ) |
188 | { | 189 | { |
189 | if ( mode > m_disable_suspend ) | 190 | if ( mode > m_disable_suspend ) |
190 | setInterval ( -1 ); | 191 | setInterval ( -1 ); |
191 | m_disable_suspend = mode; | 192 | m_disable_suspend = mode; |
192 | } | 193 | } |
193 | 194 | ||
194 | 195 | ||
@@ -203,39 +204,40 @@ void OpieScreenSaver::setMode ( int mode ) | |||
203 | */ | 204 | */ |
204 | void OpieScreenSaver::setBacklight ( int bright ) | 205 | void OpieScreenSaver::setBacklight ( int bright ) |
205 | { | 206 | { |
206 | // Read from config | 207 | // Read from config |
207 | Config config ( "apm" ); | 208 | Config config ( "apm" ); |
208 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); | 209 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); |
209 | m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 ); | 210 | m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 ); |
210 | int contrast = config. readNumEntry ( "Contrast", 127); | 211 | int contrast = config. readNumEntry ( "Contrast", 127); |
211 | m_use_light_sensor = config. readBoolEntry ( "LightSensor", false ); | 212 | m_use_light_sensor = config. readBoolEntry ( "LightSensor", false ); |
212 | 213 | ||
213 | //qDebug ( "setBacklight: %d (norm: %d) (ls: %d)", bright, m_backlight_normal, m_use_light_sensor ? 1 : 0 ); | 214 | //odebug << "setBacklight: " << bright << " (norm: " << m_backlight_normal << ") (ls: " |
214 | 215 | // << ( m_use_light_sensor ? 1 : 0 ) << ")" << oendl; | |
215 | killTimers ( ); | 216 | |
216 | if (( bright < 0 ) && m_use_light_sensor ) { | 217 | killTimers ( ); |
217 | QStringList sl = config. readListEntry ( "LightSensorData", ';' ); | 218 | if (( bright < 0 ) && m_use_light_sensor ) { |
218 | 219 | QStringList sl = config. readListEntry ( "LightSensorData", ';' ); | |
219 | m_sensordata [LS_SensorMin] = 40; | 220 | |
220 | m_sensordata [LS_SensorMax] = 215; | 221 | m_sensordata [LS_SensorMin] = 40; |
221 | m_sensordata [LS_LightMin] = 1; | 222 | m_sensordata [LS_SensorMax] = 215; |
222 | m_sensordata [LS_LightMax] = 255; | 223 | m_sensordata [LS_LightMin] = 1; |
223 | m_sensordata [LS_Steps] = 12; | 224 | m_sensordata [LS_LightMax] = 255; |
224 | m_sensordata [LS_Interval] = 2000; | 225 | m_sensordata [LS_Steps] = 12; |
225 | 226 | m_sensordata [LS_Interval] = 2000; | |
226 | for ( uint i = 0; i < LS_Count; i++ ) { | 227 | |
227 | if ( i < sl. count ( )) | 228 | for ( uint i = 0; i < LS_Count; i++ ) { |
228 | m_sensordata [i] = sl [i]. toInt ( ); | 229 | if ( i < sl. count ( )) |
229 | } | 230 | m_sensordata [i] = sl [i]. toInt ( ); |
230 | if ( m_sensordata [LS_Steps] < 2 ) // sanity check to avoid SIGFPE | 231 | } |
231 | m_sensordata [LS_Steps] = 2; | 232 | if ( m_sensordata [LS_Steps] < 2 ) // sanity check to avoid SIGFPE |
232 | 233 | m_sensordata [LS_Steps] = 2; | |
233 | timerEvent ( 0 ); | 234 | |
234 | startTimer ( m_sensordata [LS_Interval] ); | 235 | timerEvent ( 0 ); |
235 | } | 236 | startTimer ( m_sensordata [LS_Interval] ); |
236 | 237 | } | |
237 | setBacklightInternal ( bright ); | 238 | |
238 | ODevice::inst ( )-> setDisplayContrast(contrast); | 239 | setBacklightInternal ( bright ); |
240 | ODevice::inst ( )-> setDisplayContrast(contrast); | ||
239 | } | 241 | } |
240 | 242 | ||
241 | 243 | ||
@@ -250,25 +252,25 @@ void OpieScreenSaver::setBacklight ( int bright ) | |||
250 | */ | 252 | */ |
251 | void OpieScreenSaver::setBacklightInternal ( int bright ) | 253 | void OpieScreenSaver::setBacklightInternal ( int bright ) |
252 | { | 254 | { |
253 | if ( bright == -3 ) { | 255 | if ( bright == -3 ) { |
254 | // Forced on | 256 | // Forced on |
255 | m_backlight_forcedoff = false; | 257 | m_backlight_forcedoff = false; |
256 | bright = -1; | 258 | bright = -1; |
257 | } | 259 | } |
258 | if ( m_backlight_forcedoff && bright != -2 ) | 260 | if ( m_backlight_forcedoff && bright != -2 ) |
259 | return ; | 261 | return ; |
260 | if ( bright == -2 ) { | 262 | if ( bright == -2 ) { |
261 | // Toggle between off and on | 263 | // Toggle between off and on |
262 | bright = m_backlight_current ? 0 : -1; | 264 | bright = m_backlight_current ? 0 : -1; |
263 | m_backlight_forcedoff = !bright; | 265 | m_backlight_forcedoff = !bright; |
264 | } | 266 | } |
265 | if ( bright == -1 ) | 267 | if ( bright == -1 ) |
266 | bright = m_use_light_sensor ? m_backlight_sensor : m_backlight_normal; | 268 | bright = m_use_light_sensor ? m_backlight_sensor : m_backlight_normal; |
267 | 269 | ||
268 | if ( bright != m_backlight_current ) { | 270 | if ( bright != m_backlight_current ) { |
269 | ODevice::inst ( )-> setDisplayBrightness ( bright ); | 271 | ODevice::inst ( )-> setDisplayBrightness ( bright ); |
270 | m_backlight_current = bright; | 272 | m_backlight_current = bright; |
271 | } | 273 | } |
272 | } | 274 | } |
273 | 275 | ||
274 | 276 | ||
@@ -278,25 +280,27 @@ void OpieScreenSaver::setBacklightInternal ( int bright ) | |||
278 | */ | 280 | */ |
279 | void OpieScreenSaver::timerEvent ( QTimerEvent * ) | 281 | void OpieScreenSaver::timerEvent ( QTimerEvent * ) |
280 | { | 282 | { |
281 | int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( ); | 283 | int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( ); |
282 | 284 | ||
283 | if ( s < m_sensordata [LS_SensorMin] ) | 285 | if ( s < m_sensordata [LS_SensorMin] ) |
284 | m_backlight_sensor = m_sensordata [LS_LightMax]; | 286 | m_backlight_sensor = m_sensordata [LS_LightMax]; |
285 | else if ( s >= m_sensordata [LS_SensorMax] ) | 287 | else if ( s >= m_sensordata [LS_SensorMax] ) |
286 | m_backlight_sensor = m_sensordata [LS_LightMin]; | 288 | m_backlight_sensor = m_sensordata [LS_LightMin]; |
287 | else { | 289 | else { |
288 | int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; | 290 | int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; |
289 | int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; | 291 | int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; |
290 | 292 | ||
291 | int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 | 293 | int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 |
292 | 294 | ||
293 | m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); | 295 | m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); |
294 | } | 296 | } |
295 | 297 | ||
296 | //qDebug ( "f(%d) = %d [%d - %d] -> [%d - %d] / %d", s, m_backlight_sensor, m_sensordata [LS_SensorMin], m_sensordata [LS_SensorMax], m_sensordata [LS_LightMin], m_sensordata [LS_LightMax], m_sensordata [LS_Steps] ); | 298 | odebug << "f(" << s << ") = " << m_backlight_sensor << " [" << m_sensordata [LS_SensorMin] |
299 | << " - " << m_sensordata [LS_SensorMax] << " ] -> [" << m_sensordata [LS_LightMin] | ||
300 | << " - " << m_sensordata [LS_LightMax] << "] / " << m_sensordata [LS_Steps] << oendl; | ||
297 | 301 | ||
298 | if ( m_level <= 0 ) | 302 | if ( m_level <= 0 ) |
299 | setBacklightInternal ( -1 ); | 303 | setBacklightInternal ( -1 ); |
300 | } | 304 | } |
301 | 305 | ||
302 | 306 | ||
@@ -305,10 +309,10 @@ void OpieScreenSaver::timerEvent ( QTimerEvent * ) | |||
305 | */ | 309 | */ |
306 | void OpieScreenSaver::setDisplayState ( bool on ) | 310 | void OpieScreenSaver::setDisplayState ( bool on ) |
307 | { | 311 | { |
308 | if ( m_lcd_status != on ) { | 312 | if ( m_lcd_status != on ) { |
309 | ODevice::inst ( ) -> setDisplayStatus ( on ); | 313 | ODevice::inst ( ) -> setDisplayStatus ( on ); |
310 | m_lcd_status = on; | 314 | m_lcd_status = on; |
311 | } | 315 | } |
312 | } | 316 | } |
313 | 317 | ||
314 | 318 | ||
@@ -317,12 +321,12 @@ void OpieScreenSaver::setDisplayState ( bool on ) | |||
317 | */ | 321 | */ |
318 | void OpieScreenSaver::powerStatusChanged ( PowerStatus ps ) | 322 | void OpieScreenSaver::powerStatusChanged ( PowerStatus ps ) |
319 | { | 323 | { |
320 | bool newonac = ( ps. acStatus ( ) == PowerStatus::Online ); | 324 | bool newonac = ( ps. acStatus ( ) == PowerStatus::Online ); |
321 | 325 | ||
322 | if ( newonac != m_on_ac ) { | 326 | if ( newonac != m_on_ac ) { |
323 | m_on_ac = newonac; | 327 | m_on_ac = newonac; |
324 | setInterval ( -1 ); | 328 | setInterval ( -1 ); |
325 | setBacklight ( -1 ); | 329 | setBacklight ( -1 ); |
326 | restore ( ); | 330 | restore ( ); |
327 | } | 331 | } |
328 | } | 332 | } |