mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Having the KCMs that are mobile specific here makes more sense than in the settings application. Historically plasma-settings had a faster release cycle than Plasma, but the application is now moving to the Plasma release schedule and so it makes sense do this now.
42 lines
885 B
C++
42 lines
885 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2015 Kai Uwe Broulik <kde@privat.broulik.de>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QList>
|
|
|
|
#include <Solid/Battery>
|
|
#include <Solid/Device>
|
|
|
|
class BatteryModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
|
|
|
|
public:
|
|
explicit BatteryModel(QObject *parent);
|
|
~BatteryModel() override = default;
|
|
|
|
enum Roles {
|
|
BatteryRole = Qt::UserRole,
|
|
UdiRole,
|
|
VendorRole,
|
|
ProductRole,
|
|
};
|
|
Q_ENUM(Roles)
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
signals:
|
|
void countChanged();
|
|
|
|
private:
|
|
QList<Solid::Device> m_batteries;
|
|
};
|