Skip to content

Commit

Permalink
Move initBattery to private side as it's not used outside
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed Dec 19, 2017
1 parent 5d2cde6 commit c411b12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/notifications/batterynotifier.h
Expand Up @@ -28,7 +28,8 @@ class ContextProperty;
/*!
* Implements the configuration and state for the battery, the power save mode.
*/
class BatteryNotifier : public QObject {
class BatteryNotifier : public QObject
{
Q_OBJECT

public:
Expand Down Expand Up @@ -89,9 +90,6 @@ class BatteryNotifier : public QObject {
};

public slots:
//! Initializes the battery status from the current values given by QBatteryInfo
void initBattery();

//! Sends a low battery notification
void lowBatteryAlert();

Expand All @@ -103,6 +101,7 @@ public slots:
void setTouchScreenLockActive(bool active);

private slots:
void initBattery();
void onPowerSaveModeChanged();
void onPropertyChanged();
void prepareNotification();
Expand Down
3 changes: 2 additions & 1 deletion src/notifications/lowbatterynotifier.h
Expand Up @@ -33,7 +33,8 @@ class QTimer;
* The LowBatteryNotifier will emit a lowBatteryAlert() when the user should
* be alerted about a low battery condition.
*/
class LowBatteryNotifier : public QObject {
class LowBatteryNotifier : public QObject
{
Q_OBJECT

public:
Expand Down
6 changes: 2 additions & 4 deletions src/utilities/qobjectlistmodel.cpp
Expand Up @@ -59,8 +59,7 @@ QVariant QObjectListModel::data(const QModelIndex &index, int role) const
if (index.row() < 0 || index.row() >= _list->count())
return QVariant();

if (role == Qt::UserRole + 1)
{
if (role == Qt::UserRole + 1) {
QObject *obj = _list->at(index.row());
return QVariant::fromValue(obj);
}
Expand All @@ -73,8 +72,7 @@ bool QObjectListModel::setData(const QModelIndex &index, const QVariant &value,
if (index.row() < 0 || index.row() >= _list->count())
return false;

if (role == Qt::UserRole + 1)
{
if (role == Qt::UserRole + 1) {
_list->replace(index.row(), reinterpret_cast<QObject*>(value.toInt()));
return true;
}
Expand Down

0 comments on commit c411b12

Please sign in to comment.