BatteryNotifier::BatteryNotifier(QObject *parent) : QObject(parent), lowBatteryNotifier(0), notificationId(0), touchScreenLockActive(false), batteryInfo(new QBatteryInfo(this)), qmDeviceMode(new MeeGo::QmDeviceMode(this)), chargerType(QBatteryInfo::UnknownCharger) { #ifndef UNIT_TEST connect(batteryInfo, SIGNAL(batteryStatusChanged(int,QBatteryInfo::BatteryStatus)), this, SLOT(applyBatteryStatus(int,QBatteryInfo::BatteryStatus))); connect(batteryInfo, SIGNAL(chargingStateChanged(int,QBatteryInfo::ChargingState)), this, SLOT(applyChargingState(int,QBatteryInfo::ChargingState))); connect(batteryInfo, SIGNAL(chargerTypeChanged(QBatteryInfo::ChargerType)), this, SLOT(applyChargerType(QBatteryInfo::ChargerType))); #endif connect(qmDeviceMode, SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)), this, SLOT(applyPSMState(MeeGo::QmDeviceMode::PSMState))); notificationTimer.setInterval(5000); notificationTimer.setSingleShot(true); QTimer::singleShot(0, this, SLOT(initBattery())); }
BatteryNotifier::BatteryNotifier(QObject *parent) : QObject(parent), lowBatteryNotifier(0), notificationId(0), touchScreenLockActive(false), batteryInfo(new QtMobility::QSystemBatteryInfo(this)), qmDeviceMode(new MeeGo::QmDeviceMode(this)), qmLed(new MeeGo::QmLED(this)), chargerType(QtMobility::QSystemBatteryInfo::UnknownCharger) { connect(batteryInfo, SIGNAL(batteryStatusChanged(QSystemBatteryInfo::BatteryStatus)), this, SLOT(applyBatteryStatus(QSystemBatteryInfo::BatteryStatus))); connect(batteryInfo, SIGNAL(chargingStateChanged(QSystemBatteryInfo::ChargingState)), this, SLOT(applyChargingState(QSystemBatteryInfo::ChargingState))); connect(batteryInfo, SIGNAL(chargerTypeChanged(QSystemBatteryInfo::ChargerType)), this, SLOT(applyChargerType(QSystemBatteryInfo::ChargerType))); connect(qmDeviceMode, SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)), this, SLOT(applyPSMState(MeeGo::QmDeviceMode::PSMState))); // Init battery values delayed... initBattery(); notificationTimer.setInterval(5000); notificationTimer.setSingleShot(true); }