-rw-r--r-- | core/launcher/desktop.cpp | 22 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 |
2 files changed, 11 insertions, 13 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index fa9736f..03a23dc 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -175,20 +175,13 @@ void DesktopApplication::switchLCD ( bool on ) | |||
175 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) | 175 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) |
176 | : QPEApplication( argc, argv, appType ) | 176 | : QPEApplication( argc, argv, appType ) |
177 | { | 177 | { |
178 | |||
179 | Config cfg( "apm" ); | ||
180 | cfg.setGroup( "Warnings" ); | ||
181 | //cfg.readNumEntry( "checkinterval", 10000 ) | ||
182 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | ||
183 | m_powerCritical = cfg.readNumEntry( "powercritical", 5 ); | ||
184 | |||
185 | m_ps = new PowerStatus; | 178 | m_ps = new PowerStatus; |
186 | m_ps_last = new PowerStatus; | 179 | m_ps_last = new PowerStatus; |
187 | pa = new DesktopPowerAlerter( 0 ); | 180 | pa = new DesktopPowerAlerter( 0 ); |
188 | 181 | ||
189 | m_timer = new QTimer( this ); | 182 | m_apm_timer = new QTimer ( this ); |
190 | connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) ); | 183 | connect ( m_apm_timer, SIGNAL( timeout ( )), this, SLOT( apmTimeout ( ))); |
191 | m_timer->start( 5000 ); | 184 | reloadPowerWarnSettings ( ); |
192 | 185 | ||
193 | m_last_button = 0; | 186 | m_last_button = 0; |
194 | m_button_timer = new QTimer ( ); | 187 | m_button_timer = new QTimer ( ); |
@@ -301,7 +294,12 @@ void DesktopApplication::reloadPowerWarnSettings() | |||
301 | Config cfg( "apm" ); | 294 | Config cfg( "apm" ); |
302 | cfg.setGroup( "Warnings" ); | 295 | cfg.setGroup( "Warnings" ); |
303 | 296 | ||
304 | // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); | 297 | int iv = cfg. readNumEntry ( "checkinterval", 10000 ); |
298 | |||
299 | m_apm_timer-> stop ( ); | ||
300 | if ( iv ) | ||
301 | m_apm_timer-> start ( iv ); | ||
302 | |||
305 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | 303 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); |
306 | m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); | 304 | m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); |
307 | } | 305 | } |
@@ -342,7 +340,7 @@ void DesktopApplication::sendHeldAction ( ) | |||
342 | 340 | ||
343 | 341 | ||
344 | 342 | ||
345 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int keycode, bool press, bool autoRepeat ) | 343 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) |
346 | { | 344 | { |
347 | if ( db ) { | 345 | if ( db ) { |
348 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { | 346 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { |
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index 6cb7ab2..db0173e 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -95,7 +95,7 @@ private: | |||
95 | QTimer *cardSendTimer; | 95 | QTimer *cardSendTimer; |
96 | QCopChannel *channel; | 96 | QCopChannel *channel; |
97 | OpieScreenSaver *m_screensaver; | 97 | OpieScreenSaver *m_screensaver; |
98 | QTimer * m_timer; | 98 | QTimer * m_apm_timer; |
99 | int m_powerVeryLow; | 99 | int m_powerVeryLow; |
100 | int m_powerCritical; | 100 | int m_powerCritical; |
101 | int m_currentPowerLevel; | 101 | int m_currentPowerLevel; |