@@ -154,6 +154,8 @@ class UPowerDevice: public QObject {
154
154
Q_PROPERTY (bool isLaptopBattery READ isLaptopBattery NOTIFY isLaptopBatteryChanged BINDABLE bindableIsLaptopBattery);
155
155
// / Native path of the device specific to your OS.
156
156
Q_PROPERTY (QString nativePath READ nativePath NOTIFY nativePathChanged BINDABLE bindableNativePath);
157
+ // / Model name of the device. Unlikely to be useful for internal devices.
158
+ Q_PROPERTY (QString model READ model NOTIFY modelChanged BINDABLE bindableModel);
157
159
// / If device statistics have been queried for this device yet.
158
160
// / This will be true for all devices returned from @@UPower.devices, but not the default
159
161
// / device, which may be returned before it is ready to avoid returning null.
@@ -186,6 +188,7 @@ class UPowerDevice: public QObject {
186
188
QS_BINDABLE_GETTER (QString, bIconName, iconName, bindableIconName);
187
189
QS_BINDABLE_GETTER (bool , bIsLaptopBattery, isLaptopBattery, bindableIsLaptopBattery);
188
190
QS_BINDABLE_GETTER (QString, bNativePath, nativePath, bindableNativePath);
191
+ QS_BINDABLE_GETTER (QString, bModel, model, bindableModel);
189
192
QS_BINDABLE_GETTER (bool , bReady, ready, bindableReady);
190
193
191
194
signals:
@@ -206,6 +209,7 @@ class UPowerDevice: public QObject {
206
209
void iconNameChanged ();
207
210
void isLaptopBatteryChanged ();
208
211
void nativePathChanged ();
212
+ void modelChanged ();
209
213
210
214
private slots:
211
215
void onGetAllFinished ();
@@ -227,6 +231,7 @@ private slots:
227
231
Q_OBJECT_BINDABLE_PROPERTY (UPowerDevice, QString, bIconName, &UPowerDevice::iconNameChanged);
228
232
Q_OBJECT_BINDABLE_PROPERTY (UPowerDevice, bool , bIsLaptopBattery, &UPowerDevice::isLaptopBatteryChanged);
229
233
Q_OBJECT_BINDABLE_PROPERTY (UPowerDevice, QString, bNativePath, &UPowerDevice::nativePathChanged);
234
+ Q_OBJECT_BINDABLE_PROPERTY (UPowerDevice, QString, bModel, &UPowerDevice::modelChanged);
230
235
Q_OBJECT_BINDABLE_PROPERTY (UPowerDevice, bool , bReady, &UPowerDevice::readyChanged);
231
236
232
237
QS_DBUS_BINDABLE_PROPERTY_GROUP (UPowerDevice, deviceProperties);
@@ -243,6 +248,7 @@ private slots:
243
248
QS_DBUS_PROPERTY_BINDING (UPowerDevice, pHealthPercentage, bHealthPercentage, deviceProperties, " Capacity" );
244
249
QS_DBUS_PROPERTY_BINDING (UPowerDevice, pIconName, bIconName, deviceProperties, " IconName" );
245
250
QS_DBUS_PROPERTY_BINDING (UPowerDevice, pNativePath, bNativePath, deviceProperties, " NativePath" );
251
+ QS_DBUS_PROPERTY_BINDING (UPowerDevice, pModel, bModel, deviceProperties, " Model" );
246
252
// clang-format on
247
253
248
254
DBusUPowerDevice* device = nullptr ;
0 commit comments