author | zecke <zecke> | 2004-03-13 21:27:29 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 21:27:29 (UTC) |
commit | 184a0cd9935d0a249038cdbe05488c181b273d64 (patch) (unidiff) | |
tree | c8f3508ab1be012083d9e2140221cfeb9a9ab83a /core/launcher/screensaver.cpp | |
parent | a3304e23c7f8576a4584475ef0cf49d0e588671e (diff) | |
download | opie-184a0cd9935d0a249038cdbe05488c181b273d64.zip opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.gz opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.bz2 |
Fix namespaces in the launcher.. and found a problem with my script
Diffstat (limited to 'core/launcher/screensaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/screensaver.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index e544c61..6aaab3a 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <opie2/odevice.h> | 7 | #include <opie2/odevice.h> |
8 | 8 | ||
9 | 9 | ||
10 | using namespace Opie; | 10 | using namespace Opie::Core; |
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
@@ -157,7 +157,7 @@ void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend ) | |||
157 | m_enable_suspend = ( suspend > 0 ); | 157 | m_enable_suspend = ( suspend > 0 ); |
158 | m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); | 158 | m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); |
159 | } | 159 | } |
160 | 160 | ||
161 | //qDebug("screen saver intervals: %d %d %d", dim, lightoff, suspend); | 161 | //qDebug("screen saver intervals: %d %d %d", dim, lightoff, suspend); |
162 | 162 | ||
163 | v [ 0 ] = QMAX( 1000 * dim, 100 ); | 163 | v [ 0 ] = QMAX( 1000 * dim, 100 ); |
@@ -215,14 +215,14 @@ void OpieScreenSaver::setBacklight ( int bright ) | |||
215 | killTimers ( ); | 215 | killTimers ( ); |
216 | if (( bright < 0 ) && m_use_light_sensor ) { | 216 | if (( bright < 0 ) && m_use_light_sensor ) { |
217 | QStringList sl = config. readListEntry ( "LightSensorData", ';' ); | 217 | QStringList sl = config. readListEntry ( "LightSensorData", ';' ); |
218 | 218 | ||
219 | m_sensordata [LS_SensorMin] = 40; | 219 | m_sensordata [LS_SensorMin] = 40; |
220 | m_sensordata [LS_SensorMax] = 215; | 220 | m_sensordata [LS_SensorMax] = 215; |
221 | m_sensordata [LS_LightMin] = 1; | 221 | m_sensordata [LS_LightMin] = 1; |
222 | m_sensordata [LS_LightMax] = 255; | 222 | m_sensordata [LS_LightMax] = 255; |
223 | m_sensordata [LS_Steps] = 12; | 223 | m_sensordata [LS_Steps] = 12; |
224 | m_sensordata [LS_Interval] = 2000; | 224 | m_sensordata [LS_Interval] = 2000; |
225 | 225 | ||
226 | for ( uint i = 0; i < LS_Count; i++ ) { | 226 | for ( uint i = 0; i < LS_Count; i++ ) { |
227 | if ( i < sl. count ( )) | 227 | if ( i < sl. count ( )) |
228 | m_sensordata [i] = sl [i]. toInt ( ); | 228 | m_sensordata [i] = sl [i]. toInt ( ); |
@@ -279,7 +279,7 @@ void OpieScreenSaver::setBacklightInternal ( int bright ) | |||
279 | void OpieScreenSaver::timerEvent ( QTimerEvent * ) | 279 | void OpieScreenSaver::timerEvent ( QTimerEvent * ) |
280 | { | 280 | { |
281 | int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( ); | 281 | int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( ); |
282 | 282 | ||
283 | if ( s < m_sensordata [LS_SensorMin] ) | 283 | if ( s < m_sensordata [LS_SensorMin] ) |
284 | m_backlight_sensor = m_sensordata [LS_LightMax]; | 284 | m_backlight_sensor = m_sensordata [LS_LightMax]; |
285 | else if ( s >= m_sensordata [LS_SensorMax] ) | 285 | else if ( s >= m_sensordata [LS_SensorMax] ) |
@@ -287,9 +287,9 @@ void OpieScreenSaver::timerEvent ( QTimerEvent * ) | |||
287 | else { | 287 | else { |
288 | int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; | 288 | int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; |
289 | int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; | 289 | int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; |
290 | 290 | ||
291 | int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 | 291 | int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 |
292 | 292 | ||
293 | m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); | 293 | m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); |
294 | } | 294 | } |
295 | 295 | ||
@@ -318,11 +318,11 @@ void OpieScreenSaver::setDisplayState ( bool on ) | |||
318 | void OpieScreenSaver::powerStatusChanged ( PowerStatus ps ) | 318 | void OpieScreenSaver::powerStatusChanged ( PowerStatus ps ) |
319 | { | 319 | { |
320 | bool newonac = ( ps. acStatus ( ) == PowerStatus::Online ); | 320 | bool newonac = ( ps. acStatus ( ) == PowerStatus::Online ); |
321 | 321 | ||
322 | if ( newonac != m_on_ac ) { | 322 | if ( newonac != m_on_ac ) { |
323 | m_on_ac = newonac; | 323 | m_on_ac = newonac; |
324 | setInterval ( -1 ); | 324 | setInterval ( -1 ); |
325 | setBacklight ( -1 ); | 325 | setBacklight ( -1 ); |
326 | restore ( ); | 326 | restore ( ); |
327 | } | 327 | } |
328 | } | 328 | } |