author | simon <simon> | 2002-03-25 19:33:07 (UTC) |
---|---|---|
committer | simon <simon> | 2002-03-25 19:33:07 (UTC) |
commit | 25fd130f6e411585e222c1bc0fe068344745ab77 (patch) (side-by-side diff) | |
tree | b1c23cdeaf7227b0fe712b2478ed4ec44043c106 | |
parent | 2cc5e1007a57212f4beaac1980436979d85fad3f (diff) | |
download | opie-25fd130f6e411585e222c1bc0fe068344745ab77.zip opie-25fd130f6e411585e222c1bc0fe068344745ab77.tar.gz opie-25fd130f6e411585e222c1bc0fe068344745ab77.tar.bz2 |
- no default arguments in method implementations
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 3d254fc..3b329c6 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp @@ -1,77 +1,77 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "battery.h" #include "batterystatus.h" #include <qpe/power.h> #include <qpainter.h> #include <qtimer.h> -BatteryMeter::BatteryMeter( QWidget *parent = 0 ) +BatteryMeter::BatteryMeter( QWidget *parent ) : QWidget( parent ), charging(false) { ps = new PowerStatus; startTimer( 10000 ); setFixedHeight(12); chargeTimer = new QTimer( this ); connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); timerEvent(0); } BatteryMeter::~BatteryMeter() { delete ps; } QSize BatteryMeter::sizeHint() const { return QSize(10,12); } void BatteryMeter::mouseReleaseEvent( QMouseEvent *) { if ( batteryView && batteryView->isVisible() ) { delete (QWidget *) batteryView; } else { if ( !batteryView ) batteryView = new BatteryStatus( ps ); batteryView->showMaximized(); batteryView->raise(); batteryView->show(); } } void BatteryMeter::timerEvent( QTimerEvent * ) { PowerStatus prev = *ps; *ps = PowerStatusManager::readStatus(); if ( prev != *ps ) { percent = ps->batteryPercentRemaining(); if ( !charging && ps->batteryStatus() == PowerStatus::Charging && percent < 0 ) { percent = 0; charging = true; chargeTimer->start( 500 ); } else if ( charging && ps->batteryStatus() != PowerStatus::Charging ) { charging = false; chargeTimer->stop(); |