From b2230855e61c99d5d0b8de672a3e366688beaa30 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 21 Sep 2019 16:31:27 -0700 Subject: [PATCH] Mobile: make sure QML gets notified when value changes This addresses the following warning when running the mobile app: INFO: QQmlExpression: Expression qrc:/qml/DownloadFromDiveComputer.qml:339:5 depends on non-NOTIFYable properties: INFO: QMLManager::DC_forceDownload Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 1 + mobile-widgets/qmlmanager.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 56eecd2cd..858f2c730 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1924,6 +1924,7 @@ void QMLManager::DC_setBluetoothMode(bool mode) void QMLManager::DC_setForceDownload(bool force) { DCDeviceData::instance()->setForceDownload(force); + DC_ForceDownloadChanged(); } void QMLManager::DC_setSaveDump(bool dumpMode) diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 8984f9dc2..e47119a71 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -43,7 +43,7 @@ class QMLManager : public QObject { Q_PROPERTY(QString DC_devName READ DC_devName WRITE DC_setDevName) Q_PROPERTY(QString DC_devBluetoothName READ DC_devBluetoothName WRITE DC_setDevBluetoothName) Q_PROPERTY(QString descriptor READ DC_descriptor) - Q_PROPERTY(bool DC_forceDownload READ DC_forceDownload WRITE DC_setForceDownload) + Q_PROPERTY(bool DC_forceDownload READ DC_forceDownload WRITE DC_setForceDownload NOTIFY DC_ForceDownloadChanged) Q_PROPERTY(bool DC_bluetoothMode READ DC_bluetoothMode WRITE DC_setBluetoothMode) Q_PROPERTY(bool DC_saveDump READ DC_saveDump WRITE DC_setSaveDump) Q_PROPERTY(int DC_deviceId READ DC_deviceId WRITE DC_setDeviceId) @@ -270,6 +270,7 @@ signals: void waitingForPositionChanged(); void pluggedInDeviceNameChanged(); void showNonDiveComputersChanged(); + void DC_ForceDownloadChanged(); }; #endif