I have made the following changes intended for :
  nemo:devel:mw / lipstick

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.merproject.org//request/show/149

Thank You,
Vesa Halttunen

[This message was auto-generated]

---

Request # 149:

Messages from BOSS:

State: review at 2013-04-02T12:55:50 by cibot

Reviews:
       new for home:vesuri:branches:nemo:devel:mw : 
       accepted by cibot : Prechecks succeeded.
       new for nemo:devel:mw : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:vesuri:branches:nemo:devel:mw / lipstick -> nemo:devel:mw / 
lipstick
  
changes files:
--------------
--- lipstick.changes
+++ lipstick.changes
@@ -0,0 +1,4 @@
+* Tue Apr 02 2013 Vesa Halttunen <[email protected]> - 0.10.6
+- Use QSystemBatteryInfo instead of QmBattery to get information for battery 
notifications (from Vesa)
+- Allow launcher item order to be saved (from Martin)
+

old:
----
  lipstick-0.10.5.tar.bz2

new:
----
  lipstick-0.10.6.tar.bz2

spec files:
-----------
--- lipstick.spec
+++ lipstick.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    QML toolkit for homescreen creation
-Version:    0.10.5
+Version:    0.10.6
 Release:    1
 Group:      System/Libraries
 License:    LGPLv2.1
@@ -22,6 +22,7 @@
 BuildRequires:  pkgconfig(QtCore)
 BuildRequires:  pkgconfig(QtDeclarative)
 BuildRequires:  pkgconfig(QtSensors)
+BuildRequires:  pkgconfig(QtSystemInfo)
 BuildRequires:  pkgconfig(contentaction-0.1)
 BuildRequires:  pkgconfig(mlite) >= 0.0.6
 BuildRequires:  pkgconfig(xcomposite)

other changes:
--------------

++++++ lipstick-0.10.5.tar.bz2 -> lipstick-0.10.6.tar.bz2
--- src/components/launchermodel.cpp
+++ src/components/launchermodel.cpp
@@ -39,6 +39,7 @@
     _fileSystemWatcher->addPath(defaultAppsPath);
     monitoredDirectoryChanged(defaultAppsPath);
     connect(_fileSystemWatcher, SIGNAL(directoryChanged(QString)), this, 
SLOT(monitoredDirectoryChanged(QString)));
+    connect(this, SIGNAL(rowsMoved(const QModelIndex&,int,int,const 
QModelIndex&,int)), this, SLOT(savePositions()));
 }
 
 LauncherModel::~LauncherModel()
@@ -137,6 +138,8 @@
 
         move(currentPos, gridPos);
     }
+
+    savePositions();
 }
 
 QStringList LauncherModel::directories() const
@@ -160,3 +163,18 @@
 
     emit this->directoriesChanged();
 }
+
+void LauncherModel::savePositions()
+{
+    QSettings launcherSettings("nemomobile", "lipstick");
+    QList<LauncherItem *> *currentLauncherList = getList<LauncherItem>();
+
+    int pos = 0;
+    foreach (LauncherItem *item, *currentLauncherList) {
+        launcherSettings.setValue("LauncherOrder/" + item->filePath(), pos);
+        ++pos;
+    }
+
+    launcherSettings.sync();
+}
+
--- src/components/launchermodel.h
+++ src/components/launchermodel.h
@@ -43,6 +43,9 @@
     QStringList directories() const;
     void setDirectories(QStringList);
 
+public slots:
+    void savePositions();
+
 signals:
     void directoriesChanged();
 
--- src/notifications/batterynotifier.cpp
+++ src/notifications/batterynotifier.cpp
@@ -21,17 +21,19 @@
 #include "batterynotifier.h"
 
 BatteryNotifier::BatteryNotifier(QObject *parent) :
-    QObject(parent), lowBatteryNotifier(0), notificationId(0), 
touchScreenLockActive(false)
-    ,qmBattery(new MeeGo::QmBattery),
-    qmDeviceMode(new MeeGo::QmDeviceMode),
-    qmLed(new MeeGo::QmLED),
-    chargerType(MeeGo::QmBattery::Unknown)
-{
-    connect(qmBattery, 
SIGNAL(batteryStateChanged(MeeGo::QmBattery::BatteryState)), this, 
SLOT(batteryStateChanged(MeeGo::QmBattery::BatteryState)));
-    connect(qmBattery, 
SIGNAL(chargingStateChanged(MeeGo::QmBattery::ChargingState)), this, 
SLOT(chargingStateChanged(MeeGo::QmBattery::ChargingState)));
-    connect(qmBattery, SIGNAL(chargerEvent(MeeGo::QmBattery::ChargerType)), 
this, SLOT(batteryChargerEvent(MeeGo::QmBattery::ChargerType)));
-
-    connect(qmDeviceMode, 
SIGNAL(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)), this, 
SLOT(devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState)));
+    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();
@@ -42,15 +44,12 @@
 
 BatteryNotifier::~BatteryNotifier()
 {
-    delete qmBattery;
-    delete qmDeviceMode;
-    delete qmLed;
 }
 
 void BatteryNotifier::initBattery()
 {
-    chargingStateChanged(qmBattery->getChargingState());
-    batteryStateChanged(qmBattery->getBatteryState());
+    applyChargingState(batteryInfo->chargingState());
+    applyBatteryStatus(batteryInfo->batteryStatus());
 }
 
 void BatteryNotifier::lowBatteryAlert()
@@ -58,11 +57,11 @@
     sendNotification(NotificationLowBattery);
 }
 
-void BatteryNotifier::chargingStateChanged(MeeGo::QmBattery::ChargingState 
state)
+void 
BatteryNotifier::applyChargingState(QtMobility::QSystemBatteryInfo::ChargingState
 state)
 {
     switch(state) {
-    case MeeGo::QmBattery::StateCharging:
-        if (qmBattery->getChargerType() == MeeGo::QmBattery::USB_100mA) {
+    case QtMobility::QSystemBatteryInfo::Charging:
+        if (batteryInfo->chargerType() == 
QtMobility::QSystemBatteryInfo::USB_100mACharger) {
             sendNotification(NotificationNoEnoughPower);
         } else {
             // The low battery notifications should not be sent when the 
battery is charging
@@ -73,50 +72,50 @@
         }
         break;
 
-    case MeeGo::QmBattery::StateNotCharging:
+    case QtMobility::QSystemBatteryInfo::NotCharging:
         removeNotification(QStringList() << "x-nemo.battery");
         utiliseLED(false, QString("PatternBatteryCharging"));
         break;
 
-    case MeeGo::QmBattery::StateChargingFailed:
+    case QtMobility::QSystemBatteryInfo::ChargingError:
         sendNotification(NotificationChargingNotStarted);
         break;
     }
 }
 
-void BatteryNotifier::batteryStateChanged(MeeGo::QmBattery::BatteryState state)
+void 
BatteryNotifier::applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryStatus
 status)
 {
-    switch(state) {
-    case MeeGo::QmBattery::StateFull:
+    switch(status) {
+    case QtMobility::QSystemBatteryInfo::BatteryFull:
         stopLowBatteryNotifier();
         removeNotification(QStringList() << "x-nemo.battery");
         sendNotification(NotificationChargingComplete);
         break;
 
-    case MeeGo::QmBattery::StateOK:
+    case QtMobility::QSystemBatteryInfo::BatteryOk:
         stopLowBatteryNotifier();
         break;
 
-    case MeeGo::QmBattery::StateLow:
-        if (qmBattery->getChargingState() != MeeGo::QmBattery::StateCharging) {
+    case QtMobility::QSystemBatteryInfo::BatteryLow:
+        if (batteryInfo->chargingState() != 
QtMobility::QSystemBatteryInfo::Charging) {
             // The low battery notifications should be sent only if the 
battery is not charging
             startLowBatteryNotifier();
         }
         break;
 
-    case MeeGo::QmBattery::StateEmpty:
+    case QtMobility::QSystemBatteryInfo::BatteryEmpty:
         sendNotification(NotificationRechargeBattery);
         break;
 
-    case MeeGo::QmBattery::StateError:
+    default:
         break;
     }
 }
 
-void BatteryNotifier::batteryChargerEvent(MeeGo::QmBattery::ChargerType type)
+void 
BatteryNotifier::applyChargerType(QtMobility::QSystemBatteryInfo::ChargerType 
type)
 {
     switch(type) {
-    case MeeGo::QmBattery::None:
+    case QtMobility::QSystemBatteryInfo::NoCharger:
         /*
          * After the user plugs out the charger from the device, this system
          * banner is displayed to remind the users to unplug charger from
@@ -124,26 +123,26 @@
          * notification should not be shown in case if USB cable is used for
          * charging the device.
          */
-        if (chargerType == MeeGo::QmBattery::Wall) {
+        if (chargerType == QtMobility::QSystemBatteryInfo::WallCharger) {
             removeNotification(QStringList() << "x-nemo.battery" << 
"x-nemo.battery.chargingcomplete");
             sendNotification(NotificationRemoveCharger);
         }
 
-        if (chargerType != MeeGo::QmBattery::None && chargerType != 
MeeGo::QmBattery::USB_100mA && qmBattery->getBatteryState() == 
MeeGo::QmBattery::StateLow && qmBattery->getChargingState() != 
MeeGo::QmBattery::StateCharging) {
+        if (chargerType != QtMobility::QSystemBatteryInfo::NoCharger && 
chargerType != QtMobility::QSystemBatteryInfo::USB_100mACharger && 
batteryInfo->batteryStatus() == QtMobility::QSystemBatteryInfo::BatteryLow && 
batteryInfo->chargingState() != QtMobility::QSystemBatteryInfo::Charging) {
             // A charger was connected but is no longer connected and the 
battery is low, so start low battery notifier
             startLowBatteryNotifier();
         }
         break;
 
-    case MeeGo::QmBattery::Wall:
+    case QtMobility::QSystemBatteryInfo::WallCharger:
         // Wall charger
         break;
 
-    case MeeGo::QmBattery::USB_500mA:
+    case QtMobility::QSystemBatteryInfo::USB_500mACharger:
         // USB with 500mA output
         break;
 
-    case MeeGo::QmBattery::USB_100mA:
+    case QtMobility::QSystemBatteryInfo::USB_100mACharger:
         // USB with 100mA output
         break;
 
@@ -154,11 +153,11 @@
     chargerType = type;
 }
 
-void BatteryNotifier::devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState 
PSMState)
+void BatteryNotifier::applyPSMState(MeeGo::QmDeviceMode::PSMState psmState)
 {
-    if (PSMState == MeeGo::QmDeviceMode::PSMStateOff) {
+    if (psmState == MeeGo::QmDeviceMode::PSMStateOff) {
         sendNotification(NotificationExitingPSM);
-    } else if (PSMState == MeeGo::QmDeviceMode::PSMStateOn) {
+    } else if (psmState == MeeGo::QmDeviceMode::PSMStateOn) {
         sendNotification(NotificationEnteringPSM);
     }
 }
@@ -258,7 +257,7 @@
 
 QString BatteryNotifier::chargingImageId()
 {
-    int percentage = qmBattery->getRemainingCapacityPct();
+    int percentage = batteryInfo->remainingCapacityPercent();
 
     if (percentage >= 84) {
         return QString("icon-m-energy-management-charging8");
--- src/notifications/batterynotifier.h
+++ src/notifications/batterynotifier.h
@@ -19,12 +19,14 @@
 #include <QObject>
 #include <QTimer>
 #include <QScopedPointer>
+#include <QSystemBatteryInfo>
 #include <qmled.h>
-#include <qmbattery.h>
 #include <qmdevicemode.h>
 
 class LowBatteryNotifier;
 
+using namespace QtMobility;
+
 /*!
  * Implements the configuration and state for the battery, the power save mode.
  */
@@ -57,7 +59,7 @@
     } NotificationID;
 
 public slots:
-    //! Initializes the battery status from the current values given by 
QmBattery
+    //! Initializes the battery status from the current values given by 
QSystemBatteryInfo
     void initBattery();
 
     //! Sends a low battery notification
@@ -71,10 +73,10 @@
     void setTouchScreenLockActive(bool active);
 
 private slots:
-    void batteryStateChanged(MeeGo::QmBattery::BatteryState state);
-    void chargingStateChanged(MeeGo::QmBattery::ChargingState state);
-    void batteryChargerEvent(MeeGo::QmBattery::ChargerType type);
-    void devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState PSMState);
+    void applyBatteryStatus(QSystemBatteryInfo::BatteryStatus status);
+    void applyChargingState(QSystemBatteryInfo::ChargingState state);
+    void applyChargerType(QSystemBatteryInfo::ChargerType type);
+    void applyPSMState(MeeGo::QmDeviceMode::PSMState psmState);
     void utiliseLED(bool activate, const QString &pattern);
 
 private:
@@ -112,7 +114,7 @@
     bool touchScreenLockActive;
 
     //! For getting battery state
-    MeeGo::QmBattery *qmBattery;
+    QtMobility::QSystemBatteryInfo *batteryInfo;
 
     //! For getting device mode
     MeeGo::QmDeviceMode *qmDeviceMode;
@@ -121,7 +123,7 @@
     MeeGo::QmLED *qmLed;
 
     //! The current charger type
-    MeeGo::QmBattery::ChargerType chargerType;
+    QtMobility::QSystemBatteryInfo::ChargerType chargerType;
 
 #ifdef UNIT_TEST
     friend class Ut_BatteryNotifier;
--- src/src.pro
+++ src/src.pro
@@ -3,7 +3,7 @@
 
 TEMPLATE = lib
 TARGET = lipstick
-VERSION = 0.10.5
+VERSION = 0.10.6
 
 DEFINES += LIPSTICK_BUILD_LIBRARY VERSION=\\\"$$VERSION\\\"
 
@@ -97,7 +97,7 @@
     shutdownscreen.cpp
 
 CONFIG += link_pkgconfig mobility qt warn_on depend_includepath qmake_cache 
target_qt
-MOBILITY += sensors
+MOBILITY += sensors systeminfo
 PKGCONFIG += xcomposite mlite xdamage x11 xfixes xext mce dbus-1 dbus-glib-1 
libresourceqt1 ngf-qt qmsystem2 contextsubscriber-1.0
 
 packagesExist(contentaction-0.1) {
--- tests/stubs/qmbattery_stub.h
+++ tests/stubs/qmbattery_stub.h
@@ -1,195 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** Copyright (C) 2012 Jolla Ltd.
-** Contact: Robin Burchell <[email protected]>
-**
-** This file is part of lipstick.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation
-** and appearing in the file LICENSE.LGPL included in the packaging
-** of this file.
-**
-****************************************************************************/
-#ifndef QMBATTERY_STUB
-#define QMBATTERY_STUB
-
-#include <qmbattery.h>
-#include "stubbase.h"
-/*
- * XXX: This stub contains only those methods which are 
- * used by the  BatteryBusinessLogic class ...
- */
-
-/*
- * Declare stub
- */
-class QmBatteryStub : public StubBase
-{
-public:
-    virtual MeeGo::QmBattery::ChargerType getChargerType ();
-    virtual MeeGo::QmBattery::ChargingState getChargingState ();
-    virtual MeeGo::QmBattery::BatteryState getBatteryState ();
-    virtual int getRemainingTalkTime (MeeGo::QmBattery::RemainingTimeMode 
mode);
-    virtual int getRemainingIdleTime (MeeGo::QmBattery::RemainingTimeMode 
mode);
-    virtual int getRemainingCapacityPct ();
-    virtual int getMaxBars ();
-    virtual MeeGo::QmBattery::State getState();
-    virtual MeeGo::QmBattery::Level getLevel();
-};
-
-MeeGo::QmBattery::ChargingState
-QmBatteryStub::getChargingState ()
-{
-    stubMethodEntered ("getChargingState");
-    return stubReturnValue<MeeGo::QmBattery::ChargingState> 
("getChargingState");
-}
-
-MeeGo::QmBattery::ChargerType
-QmBatteryStub::getChargerType ()
-{
-    stubMethodEntered ("getChargerType");
-    return stubReturnValue<MeeGo::QmBattery::ChargerType> ("getChargerType");
-}
-
-
-MeeGo::QmBattery::BatteryState
-QmBatteryStub::getBatteryState ()
-{
-    stubMethodEntered ("getBatteryState");
-    return stubReturnValue<MeeGo::QmBattery::BatteryState> ("getBatteryState");
-}
-
-
-int
-QmBatteryStub::getRemainingTalkTime (MeeGo::QmBattery::RemainingTimeMode mode)
-{
-    QList<ParameterBase*> params;
-    params.append (new Parameter<MeeGo::QmBattery::RemainingTimeMode> (mode));
-    stubMethodEntered ("getRemainingTalkTime", params);
-    return stubReturnValue<int> ("getRemainingTalkTime");
-}
-
-int
-QmBatteryStub::getRemainingIdleTime (MeeGo::QmBattery::RemainingTimeMode mode)
-{
-    QList<ParameterBase*> params;
-    params.append (new Parameter<MeeGo::QmBattery::RemainingTimeMode> (mode));
-    stubMethodEntered ("getRemainingIdleTime", params);
-    return stubReturnValue<int> ("getRemainingIdleTime");
-}
-
-int
-QmBatteryStub::getRemainingCapacityPct ()
-{
-    stubMethodEntered ("getRemainingCapacityPct");
-    return stubReturnValue<int> ("getRemainingCapacityPct");
-}
-
-int
-QmBatteryStub::getMaxBars ()
-{
-    stubMethodEntered ("getMaxBars");
-    return stubReturnValue<int> ("getMaxBars");
-}
-
-MeeGo::QmBattery::State QmBatteryStub::getState()
-{
-    stubMethodEntered ("getState");
-    return stubReturnValue<MeeGo::QmBattery::State> ("getState");
-}
-
-MeeGo::QmBattery::Level QmBatteryStub::getLevel()
-{
-    stubMethodEntered ("getLevel");
-    return stubReturnValue<MeeGo::QmBattery::Level> ("getLevel");
-}
-
-
-/*
- * Create a stub instance
- */
-QmBatteryStub gDefaultQmBatteryStub;
-QmBatteryStub *gQmBatteryStub = &gDefaultQmBatteryStub;
-
-/*
- * Create a proxy which calls the stub
- */
-namespace MeeGo
-{
-
-class QmBatteryPrivate
-{
-    /* Dummy class... */
-};
-
-QmBattery::QmBattery (QObject *parent)
-{
-    Q_UNUSED (parent);
-    /*
-     * Do nothing, we don't want to instantiate a real QmBattery...
-     */
-}
-
-QmBattery::~QmBattery ()
-{
-
-}
-
-QmBattery::ChargerType
-QmBattery::getChargerType () const
-{
-    return gQmBatteryStub->getChargerType ();
-}
-
-QmBattery::ChargingState
-QmBattery::getChargingState() const
-{
-    return gQmBatteryStub->getChargingState ();
-}
-
-QmBattery::BatteryState
-QmBattery::getBatteryState () const
-{
-    return gQmBatteryStub->getBatteryState ();
-}
-
-int
-QmBattery::getRemainingTalkTime (QmBattery::RemainingTimeMode mode) const
-{
-    return gQmBatteryStub->getRemainingTalkTime (mode);
-}
-
-int
-QmBattery::getRemainingIdleTime (QmBattery::RemainingTimeMode mode) const
-{
-    return gQmBatteryStub->getRemainingIdleTime (mode);
-}
-
-int
-QmBattery::getRemainingCapacityPct () const
-{
-    return gQmBatteryStub->getRemainingCapacityPct ();
-}
-
-int
-QmBattery::getMaxBars () const
-{
-    return gQmBatteryStub->getMaxBars ();
-}
-
-QmBattery::State QmBattery::getState () const
-{
-    return gQmBatteryStub->getState();
-}
-
-QmBattery::Level QmBattery::getLevel() const
-{
-    return gQmBatteryStub->getLevel();
-}
-
-} /* namespace MeeGo */
-
-#endif
--- tests/stubs/qsystembatteryinfo_stub.h
+++ tests/stubs/qsystembatteryinfo_stub.h
@@ -0,0 +1,168 @@
+#ifndef QSYSTEMBATTERYINFO_STUB
+#define QSYSTEMBATTERYINFO_STUB
+
+#include "qsystembatteryinfo.h"
+#include <stubbase.h>
+
+
+// 1. DECLARE STUB
+// FIXME - stubgen is not yet finished
+class QSystemBatteryInfoStub : public StubBase {
+  public:
+  virtual void QSystemBatteryInfoConstructor(QObject *parent);
+  virtual void QSystemBatteryInfoDestructor();
+  virtual QtMobility::QSystemBatteryInfo::ChargerType chargerType() const;
+  virtual QtMobility::QSystemBatteryInfo::ChargingState chargingState() const;
+  virtual int nominalCapacity() const;
+  virtual int remainingCapacityPercent() const;
+  virtual int remainingCapacity() const;
+  virtual int voltage() const;
+  virtual int remainingChargingTime() const;
+  virtual int currentFlow() const;
+  virtual int remainingCapacityBars() const;
+  virtual int maxBars() const;
+  virtual QtMobility::QSystemBatteryInfo::BatteryStatus batteryStatus() const;
+  virtual QtMobility::QSystemBatteryInfo::EnergyUnit energyMeasurementUnit() 
const;
+}; 
+
+// 2. IMPLEMENT STUB
+void QSystemBatteryInfoStub::QSystemBatteryInfoConstructor(QObject *parent) {
+  Q_UNUSED(parent);
+
+}
+void QSystemBatteryInfoStub::QSystemBatteryInfoDestructor() {
+
+}
+QtMobility::QSystemBatteryInfo::ChargerType 
QSystemBatteryInfoStub::chargerType() const {
+  stubMethodEntered("chargerType");
+  return 
stubReturnValue<QtMobility::QSystemBatteryInfo::ChargerType>("chargerType");
+}
+
+QtMobility::QSystemBatteryInfo::ChargingState 
QSystemBatteryInfoStub::chargingState() const {
+  stubMethodEntered("chargingState");
+  return 
stubReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState");
+}
+
+int QSystemBatteryInfoStub::nominalCapacity() const {
+  stubMethodEntered("nominalCapacity");
+  return stubReturnValue<int>("nominalCapacity");
+}
+
+int QSystemBatteryInfoStub::remainingCapacityPercent() const {
+  stubMethodEntered("remainingCapacityPercent");
+  return stubReturnValue<int>("remainingCapacityPercent");
+}
+
+int QSystemBatteryInfoStub::remainingCapacity() const {
+  stubMethodEntered("remainingCapacity");
+  return stubReturnValue<int>("remainingCapacity");
+}
+
+int QSystemBatteryInfoStub::voltage() const {
+  stubMethodEntered("voltage");
+  return stubReturnValue<int>("voltage");
+}
+
+int QSystemBatteryInfoStub::remainingChargingTime() const {
+  stubMethodEntered("remainingChargingTime");
+  return stubReturnValue<int>("remainingChargingTime");
+}
+
+int QSystemBatteryInfoStub::currentFlow() const {
+  stubMethodEntered("currentFlow");
+  return stubReturnValue<int>("currentFlow");
+}
+
+int QSystemBatteryInfoStub::remainingCapacityBars() const {
+  stubMethodEntered("remainingCapacityBars");
+  return stubReturnValue<int>("remainingCapacityBars");
+}
+
+int QSystemBatteryInfoStub::maxBars() const {
+  stubMethodEntered("maxBars");
+  return stubReturnValue<int>("maxBars");
+}
+
+QtMobility::QSystemBatteryInfo::BatteryStatus 
QSystemBatteryInfoStub::batteryStatus() const {
+  stubMethodEntered("batteryStatus");
+  return 
stubReturnValue<QtMobility::QSystemBatteryInfo::BatteryStatus>("batteryStatus");
+}
+
+QtMobility::QSystemBatteryInfo::EnergyUnit 
QSystemBatteryInfoStub::energyMeasurementUnit() const {
+  stubMethodEntered("energyMeasurementUnit");
+  return 
stubReturnValue<QtMobility::QSystemBatteryInfo::EnergyUnit>("energyMeasurementUnit");
+}
+
+
+
+// 3. CREATE A STUB INSTANCE
+QSystemBatteryInfoStub gDefaultQSystemBatteryInfoStub;
+QSystemBatteryInfoStub* gQSystemBatteryInfoStub = 
&gDefaultQSystemBatteryInfoStub;
+
+
+// 4. CREATE A PROXY WHICH CALLS THE STUB
+QtMobility::QSystemBatteryInfo::QSystemBatteryInfo(QObject *parent) : 
QObject(parent) {
+  gQSystemBatteryInfoStub->QSystemBatteryInfoConstructor(parent);
+}
+
+QtMobility::QSystemBatteryInfo::~QSystemBatteryInfo() {
+  gQSystemBatteryInfoStub->QSystemBatteryInfoDestructor();
+}
+
+QtMobility::QSystemBatteryInfo::ChargerType 
QtMobility::QSystemBatteryInfo::chargerType() const {
+  return gQSystemBatteryInfoStub->chargerType();
+}
+
+QtMobility::QSystemBatteryInfo::ChargingState 
QtMobility::QSystemBatteryInfo::chargingState() const {
+  return gQSystemBatteryInfoStub->chargingState();
+}
+
+int QtMobility::QSystemBatteryInfo::nominalCapacity() const {
+  return gQSystemBatteryInfoStub->nominalCapacity();
+}
+
+int QtMobility::QSystemBatteryInfo::remainingCapacityPercent() const {
+  return gQSystemBatteryInfoStub->remainingCapacityPercent();
+}
+
+int QtMobility::QSystemBatteryInfo::remainingCapacity() const {
+  return gQSystemBatteryInfoStub->remainingCapacity();
+}
+
+int QtMobility::QSystemBatteryInfo::voltage() const {
+  return gQSystemBatteryInfoStub->voltage();
+}
+
+int QtMobility::QSystemBatteryInfo::remainingChargingTime() const {
+  return gQSystemBatteryInfoStub->remainingChargingTime();
+}
+
+int QtMobility::QSystemBatteryInfo::currentFlow() const {
+  return gQSystemBatteryInfoStub->currentFlow();
+}
+
+int QtMobility::QSystemBatteryInfo::remainingCapacityBars() const {
+  return gQSystemBatteryInfoStub->remainingCapacityBars();
+}
+
+int QtMobility::QSystemBatteryInfo::maxBars() const {
+  return gQSystemBatteryInfoStub->maxBars();
+}
+
+QtMobility::QSystemBatteryInfo::BatteryStatus 
QtMobility::QSystemBatteryInfo::batteryStatus() const {
+  return gQSystemBatteryInfoStub->batteryStatus();
+}
+
+QtMobility::QSystemBatteryInfo::EnergyUnit 
QtMobility::QSystemBatteryInfo::energyMeasurementUnit() const {
+  return gQSystemBatteryInfoStub->energyMeasurementUnit();
+}
+
+void QtMobility::QSystemBatteryInfo::connectNotify(const char *)
+{
+}
+
+void QtMobility::QSystemBatteryInfo::disconnectNotify(const char *)
+{
+}
+
+#endif
--- tests/ut_batterynotifier/ut_batterynotifier.cpp
+++ tests/ut_batterynotifier/ut_batterynotifier.cpp
@@ -19,7 +19,7 @@
 #include "lowbatterynotifier_stub.h"
 #include "notificationmanager_stub.h"
 #include "qmled_stub.h"
-#include "qmbattery_stub.h"
+#include "qsystembatteryinfo_stub.h"
 #include "qmdevicemode_stub.h"
 #include "qmdisplaystate_stub.h"
 #include "batterynotifier.h"
@@ -52,13 +52,13 @@
     batteryNotifier = NULL;
     gNotificationManagerStub->stubReset();
     gLowBatteryNotifierStub->stubReset();
-    gQmBatteryStub->stubReset();
+    gQSystemBatteryInfoStub->stubReset();
 }
 
 void Ut_BatteryNotifier::testInitBattery()
 {
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState",
 MeeGo::QmBattery::StateNotCharging);
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::BatteryState>("getBatteryState",
 MeeGo::QmBattery::StateOK);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState",
 QtMobility::QSystemBatteryInfo::NotCharging);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::BatteryStatus>("batteryStatus",
 QtMobility::QSystemBatteryInfo::BatteryOk);
 
     // no notification should be shown and battery charging pattern should be 
deactivated
     batteryNotifier->initBattery();
@@ -81,11 +81,11 @@
 {
     QList<QVariant> arguments;
 
-    gQmBatteryStub->stubReset();
+    gQSystemBatteryInfoStub->stubReset();
     gQmLEDStub->stubReset();
 
     /* StateFull */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateFull);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryFull);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.chargingcomplete"));
@@ -94,13 +94,13 @@
     QCOMPARE(gQmLEDStub->stubLastCallTo("activate").parameter<QString>(0), 
QString("PatternBatteryFull"));
 
     /* StateOK */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateOK);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryOk);
 
     /* no notifications should be published, just silently no-op */
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
 
     /* StateEmpty */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateEmpty);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryEmpty);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 2);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.recharge"));
@@ -108,22 +108,22 @@
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QString>(2),
 QString());
 
     /* StateError */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateError);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryUnknown);
 
     /* no notifications should be published, just silently no-op */
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 2);
 
     /* StateLow and charging */
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState",
 MeeGo::QmBattery::StateCharging);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState",
 QtMobility::QSystemBatteryInfo::Charging);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
 
     /* no notifications should be published, because battery is charging... */
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 2);
 
     /* StateLow and not charging */
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState",
 MeeGo::QmBattery::StateNotCharging);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState",
 QtMobility::QSystemBatteryInfo::NotCharging);
     batteryNotifier->setTouchScreenLockActive(true);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
 
     
QCOMPARE(gLowBatteryNotifierStub->stubCallCount("setTouchScreenLockActive"), 1);
     
QCOMPARE(gLowBatteryNotifierStub->stubLastCallTo("setTouchScreenLockActive").parameter<bool>(0),
 true);
@@ -134,15 +134,15 @@
 {
     QList<QVariant> arguments;
 
-    gQmBatteryStub->stubReset();
+    gQSystemBatteryInfoStub->stubReset();
     gQmLEDStub->stubReset();
 
-    gQmBatteryStub->stubSetReturnValue("getChargerType", 
MeeGo::QmBattery::Wall);
+    gQSystemBatteryInfoStub->stubSetReturnValue("chargerType", 
QtMobility::QSystemBatteryInfo::WallCharger);
 
     for(int i = 0; i <= 100; i += 5) {
         /* StateCharging */
-        gQmBatteryStub->stubSetReturnValue<int>("getRemainingCapacityPct", i);
-        batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+        
gQSystemBatteryInfoStub->stubSetReturnValue<int>("remainingCapacityPercent", i);
+        
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
 
         QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
         
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery"));
@@ -154,13 +154,13 @@
     }
 
     /* StateNotCharging */
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateNotCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::NotCharging);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 0);
     QCOMPARE(gQmLEDStub->stubLastCallTo("deactivate").parameter<QString>(0), 
QString("PatternBatteryCharging"));
 
     /* StateChargingFailed */
-    
batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateChargingFailed);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::ChargingError);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.chargingnotstarted"));
@@ -168,8 +168,8 @@
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QString>(2),
 QString());
 
     /* Test "not enough power to charge" situation... */
-    gQmBatteryStub->stubSetReturnValue("getChargerType", 
MeeGo::QmBattery::USB_100mA);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    gQSystemBatteryInfoStub->stubSetReturnValue("chargerType", 
QtMobility::QSystemBatteryInfo::USB_100mACharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 2);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.notenoughpower"));
@@ -182,12 +182,12 @@
     QList<QVariant> arguments;
 
     /* Wall charger */
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    QCOMPARE(batteryNotifier->chargerType, MeeGo::QmBattery::Wall);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    QCOMPARE(batteryNotifier->chargerType, 
QtMobility::QSystemBatteryInfo::WallCharger);
 
     /* Plug out : charger type = none */
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::None);
-    QCOMPARE(batteryNotifier->chargerType, MeeGo::QmBattery::None);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::NoCharger);
+    QCOMPARE(batteryNotifier->chargerType, 
QtMobility::QSystemBatteryInfo::NoCharger);
 
     /* Look for the notification: "Disconnect the charger from..." */
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
@@ -196,16 +196,16 @@
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QString>(2),
 QString());
 
     /* USB 500mA */
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::USB_500mA);
-    QCOMPARE(batteryNotifier->chargerType, MeeGo::QmBattery::USB_500mA);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::USB_500mACharger);
+    QCOMPARE(batteryNotifier->chargerType, 
QtMobility::QSystemBatteryInfo::USB_500mACharger);
 
     /* USB 100mA */
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::USB_100mA);
-    QCOMPARE(batteryNotifier->chargerType, MeeGo::QmBattery::USB_100mA);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::USB_100mACharger);
+    QCOMPARE(batteryNotifier->chargerType, 
QtMobility::QSystemBatteryInfo::USB_100mACharger);
 
     /* Unknown */
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Unknown);
-    QCOMPARE(batteryNotifier->chargerType, MeeGo::QmBattery::Unknown);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::UnknownCharger);
+    QCOMPARE(batteryNotifier->chargerType, 
QtMobility::QSystemBatteryInfo::UnknownCharger);
 }
 
 void Ut_BatteryNotifier::testPSMStateChanged()
@@ -213,7 +213,7 @@
     QList<QVariant> arguments;
 
     /* Entering to power-save mode */
-    batteryNotifier->devicePSMStateChanged(MeeGo::QmDeviceMode::PSMStateOn);
+    batteryNotifier->applyPSMState(MeeGo::QmDeviceMode::PSMStateOn);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.enterpsm"));
@@ -221,7 +221,7 @@
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QString>(2),
 batteryNotifier->chargingImageId());
 
     /* Exiting from power-save mode */
-    batteryNotifier->devicePSMStateChanged(MeeGo::QmDeviceMode::PSMStateOff);
+    batteryNotifier->applyPSMState(MeeGo::QmDeviceMode::PSMStateOff);
 
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 2);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery.exitpsm"));
@@ -233,15 +233,15 @@
 {
     QList<QVariant> arguments;
 
-    gQmBatteryStub->stubSetReturnValue("getChargerType", 
MeeGo::QmBattery::USB_500mA);
+    gQSystemBatteryInfoStub->stubSetReturnValue("chargerType", 
QtMobility::QSystemBatteryInfo::USB_500mACharger);
 
     /* LowBatteryNotifier shouldn't be instantiated at first */
     QCOMPARE(batteryNotifier->lowBatteryNotifier, (LowBatteryNotifier *)NULL);
 
     /* Simulate battery-state-low change */
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState",
 MeeGo::QmBattery::StateNotCharging);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState",
 QtMobility::QSystemBatteryInfo::NotCharging);
     batteryNotifier->setTouchScreenLockActive(true);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
 
     /* LowBatteryNotifier should be exists now... */
     QVERIFY(batteryNotifier->lowBatteryNotifier != NULL);
@@ -252,87 +252,87 @@
     QCOMPARE(gLowBatteryNotifierStub->stubCallCount("sendLowBatteryAlert"), 1);
 
     /* Simulate now a charging event */
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
 
     /* After this call LowBatteryNotifier should be destroyed */
     QCOMPARE(batteryNotifier->lowBatteryNotifier, (LowBatteryNotifier *)NULL);
 
     /* State OK should stop notifications */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateOK);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryOk);
     QCOMPARE(batteryNotifier->lowBatteryNotifier, (LowBatteryNotifier *)NULL);
 
     /* State Full should stop notifications */
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateFull);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryFull);
     QCOMPARE(batteryNotifier->lowBatteryNotifier, (LowBatteryNotifier *)NULL);
 }
 
 void Ut_BatteryNotifier::testWhenChargingStopsThenNotificationRemoved()
 {
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
     QCOMPARE(gNotificationManagerStub->stubCallCount("Notify"), 1);
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_CATEGORY).toString(),
 QString("x-nemo.battery"));
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QVariantHash>(6).value(NotificationManager::HINT_PREVIEW_BODY).toString(),
 qtTrId("qtn_ener_charging"));
     
QCOMPARE(gNotificationManagerStub->stubLastCallTo("Notify").parameter<QString>(2),
 batteryNotifier->chargingImageId());
 
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateNotCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::NotCharging);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 1);
     QCOMPARE(batteryNotifier->notificationTimer.isActive(), false);
 }
 
 void 
Ut_BatteryNotifier::testWhenChargingStopsWhenConnectedToWallChargerThenNotificationRemoved()
 {
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::None);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::NoCharger);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 1);
 
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateFull);
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::None);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryFull);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::NoCharger);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 4);
 }
 
 void 
Ut_BatteryNotifier::testWhenChargingStopsMoreThanNSecondAfterBeingStartedThenNotificationNotRemoved()
 {
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
     batteryNotifier->notificationTimer.stop();
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateNotCharging);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::NotCharging);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 0);
 }
 
 void 
Ut_BatteryNotifier::testWhenChargingStartsWhenRemoveChargerNotifiedThenNotificationRemoved()
 {
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::None);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::NoCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 2);
 }
 
 void 
Ut_BatteryNotifier::testWhenChargingStopsAndBatteryIsLowNotifierIsCreated()
 {
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::BatteryState>("getBatteryState",
 MeeGo::QmBattery::StateLow);
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::None);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::BatteryStatus>("batteryStatus",
 QtMobility::QSystemBatteryInfo::BatteryLow);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::NoCharger);
     QVERIFY(batteryNotifier->lowBatteryNotifier != NULL);
 }
 
 void Ut_BatteryNotifier::testWhenStateChargingLowBatteryNotificationRemoved()
 {
     batteryNotifier->lowBatteryAlert();
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 1);
 }
 
 void 
Ut_BatteryNotifier::testWhenBatteryFullWhenChargingNotifiedThenNotificationRemoved()
 {
-    batteryNotifier->batteryChargerEvent(MeeGo::QmBattery::Wall);
-    batteryNotifier->chargingStateChanged(MeeGo::QmBattery::StateCharging);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateFull);
+    
batteryNotifier->applyChargerType(QtMobility::QSystemBatteryInfo::WallCharger);
+    
batteryNotifier->applyChargingState(QtMobility::QSystemBatteryInfo::Charging);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryFull);
     QCOMPARE(gNotificationManagerStub->stubCallCount("CloseNotification"), 1);
 }
 
@@ -341,9 +341,9 @@
     batteryNotifier->setTouchScreenLockActive(true);
     
QCOMPARE(gLowBatteryNotifierStub->stubCallCount("setTouchScreenLockActive"), 0);
 
-    gQmBatteryStub->stubSetReturnValue("getChargerType", 
MeeGo::QmBattery::USB_500mA);
-    
gQmBatteryStub->stubSetReturnValue<MeeGo::QmBattery::ChargingState>("getChargingState",
 MeeGo::QmBattery::StateNotCharging);
-    batteryNotifier->batteryStateChanged(MeeGo::QmBattery::StateLow);
+    gQSystemBatteryInfoStub->stubSetReturnValue("chargerType", 
QtMobility::QSystemBatteryInfo::USB_500mACharger);
+    
gQSystemBatteryInfoStub->stubSetReturnValue<QtMobility::QSystemBatteryInfo::ChargingState>("chargingState",
 QtMobility::QSystemBatteryInfo::NotCharging);
+    
batteryNotifier->applyBatteryStatus(QtMobility::QSystemBatteryInfo::BatteryLow);
     
QCOMPARE(gLowBatteryNotifierStub->stubCallCount("setTouchScreenLockActive"), 1);
     
QCOMPARE(gLowBatteryNotifierStub->stubLastCallTo("setTouchScreenLockActive").parameter<bool>(0),
 true);
 
--- tests/ut_batterynotifier/ut_batterynotifier.pro
+++ tests/ut_batterynotifier/ut_batterynotifier.pro
@@ -1,8 +1,9 @@
 include(../common.pri)
 TARGET = ut_batterynotifier
-CONFIG += link_pkgconfig
+CONFIG += link_pkgconfig mobility
+MOBILITY += systeminfo
 PKGCONFIG += contextsubscriber-1.0
-INCLUDEPATH += $$NOTIFICATIONSRCDIR /usr/include/qmsystem2
+INCLUDEPATH += $$NOTIFICATIONSRCDIR /usr/include/QtSystemInfo 
/usr/include/qmsystem2
 QT += dbus
 
 HEADERS += \
@@ -11,7 +12,6 @@
     $$NOTIFICATIONSRCDIR/notificationmanager.h \
     $$NOTIFICATIONSRCDIR/notification.h \
     /usr/include/qmsystem2/qmled.h \
-    /usr/include/qmsystem2/qmbattery.h \
     /usr/include/qmsystem2/qmdevicemode.h \
     /usr/include/qmsystem2/qmdisplaystate.h \
     $$STUBSDIR/stubbase.h \

++++++ lipstick.yaml
--- lipstick.yaml
+++ lipstick.yaml
@@ -1,6 +1,6 @@
 Name: lipstick
 Summary: QML toolkit for homescreen creation
-Version: 0.10.5
+Version: 0.10.6
 Release: 1
 Group: System/Libraries
 License: LGPLv2.1
@@ -13,6 +13,7 @@
     - QtCore
     - QtDeclarative
     - QtSensors
+    - QtSystemInfo
     - contentaction-0.1
     - mlite >= 0.0.6
     - xcomposite



Reply via email to