author | harlekin <harlekin> | 2004-01-04 13:43:40 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-01-04 13:43:40 (UTC) |
commit | 84f039ef3799c5310a4f94057b9d76d4ee55f499 (patch) (unidiff) | |
tree | d53ec9b3444dd338697f4ca0dd43605a499fc477 | |
parent | 8810bf223d97a98bfb746c0571ba1640c4351e8e (diff) | |
download | opie-84f039ef3799c5310a4f94057b9d76d4ee55f499.zip opie-84f039ef3799c5310a4f94057b9d76d4ee55f499.tar.gz opie-84f039ef3799c5310a4f94057b9d76d4ee55f499.tar.bz2 |
patch by Brad Campbell <brad@wasp.net.au>, show charging info correct again, thanks
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 15eb762..4adcab4 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp | |||
@@ -87,13 +87,13 @@ void BatteryMeter::timerEvent( QTimerEvent * ) | |||
87 | PowerStatus prev = *ps; | 87 | PowerStatus prev = *ps; |
88 | 88 | ||
89 | *ps = PowerStatusManager::readStatus(); | 89 | *ps = PowerStatusManager::readStatus(); |
90 | 90 | ||
91 | if ( prev != *ps ) { | 91 | if ( prev != *ps ) { |
92 | percent = ps->batteryPercentRemaining(); | 92 | percent = ps->batteryPercentRemaining(); |
93 | if ( !charging && ps->batteryStatus() == PowerStatus::Charging && percent < 0 ) { | 93 | if ( !charging && ps->batteryStatus() == PowerStatus::Charging ) { |
94 | percent = 0; | 94 | percent = 0; |
95 | charging = true; | 95 | charging = true; |
96 | chargeTimer->start( 500 ); | 96 | chargeTimer->start( 500 ); |
97 | } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { | 97 | } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { |
98 | charging = false; | 98 | charging = false; |
99 | chargeTimer->stop(); | 99 | chargeTimer->stop(); |
@@ -116,13 +116,13 @@ void BatteryMeter::chargeTimeout() | |||
116 | if ( batteryView ) | 116 | if ( batteryView ) |
117 | batteryView->updatePercent( percent ); | 117 | batteryView->updatePercent( percent ); |
118 | } | 118 | } |
119 | 119 | ||
120 | void BatteryMeter::paintEvent( QPaintEvent* ) | 120 | void BatteryMeter::paintEvent( QPaintEvent* ) |
121 | { | 121 | { |
122 | qWarning("paint"); | 122 | |
123 | if ( style == 1 ) | 123 | if ( style == 1 ) |
124 | { | 124 | { |
125 | QPainter p(this); | 125 | QPainter p(this); |
126 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); | 126 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); |
127 | QFontMetrics fm( f ); | 127 | QFontMetrics fm( f ); |
128 | p.setFont( f ); | 128 | p.setFont( f ); |