diff options
author | jan Iversen <jani@libreoffice.org> | 2018-06-09 16:59:02 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-06-09 21:19:46 +0200 |
commit | 470c218b79a582856aff6227a90147e0db52812b (patch) | |
tree | d232f5b099f723bfaee75eb801beb61884b79bf3 /core/downloadfromdcthread.h | |
parent | 807571a5887baa71f7271bf0fff2397090ec9489 (diff) | |
download | subsurface-470c218b79a582856aff6227a90147e0db52812b.tar.gz |
core: remove qml properties from downloadfromcthread
Remove Q_OBJECT and qml properties from DCDeviceData class
Remove DCDeviceData register from mobile-helper.cpp
Change DCDeviceData constructor to be without parameters
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/downloadfromdcthread.h')
-rw-r--r-- | core/downloadfromdcthread.h | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index 39d87a5a9..ed46dd39e 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -12,25 +12,9 @@ #include "core/btdiscovery.h" #endif /* Helper object for access of Device Data in QML */ -class DCDeviceData : public QObject { - Q_OBJECT -#ifdef SUBSURFACE_MOBILE - Q_PROPERTY(QString vendor READ vendor WRITE setVendor) - Q_PROPERTY(QString product READ product WRITE setProduct) - Q_PROPERTY(bool bluetoothMode READ bluetoothMode WRITE setBluetoothMode) - Q_PROPERTY(QString devName READ devName WRITE setDevName) - Q_PROPERTY(QString devBluetoothName READ devBluetoothName WRITE setDevBluetoothName) - Q_PROPERTY(QString descriptor READ descriptor) - Q_PROPERTY(bool forceDownload READ forceDownload WRITE setForceDownload) - Q_PROPERTY(bool createNewTrip READ createNewTrip WRITE setCreateNewTrip) - Q_PROPERTY(int deviceId READ deviceId WRITE setDeviceId) - Q_PROPERTY(int diveId READ diveId WRITE setDiveId) - Q_PROPERTY(bool saveDump READ saveDump WRITE setSaveDump) - Q_PROPERTY(bool saveLog READ saveLog WRITE setSaveLog) -#endif // SUBSURFACE_MOBILE - +class DCDeviceData { public: - DCDeviceData(QObject *parent = nullptr); + DCDeviceData(); static DCDeviceData *instance(); QString vendor() const; @@ -39,39 +23,24 @@ public: bool bluetoothMode() const; bool saveDump() const; QString devBluetoothName() const; -#ifdef SUBSURFACE_MOBILE QString descriptor() const; bool forceDownload() const; bool createNewTrip() const; bool saveLog() const; int deviceId() const; int diveId() const; -#endif // SUBSURFACE_MOBILE /* this needs to be a pointer to make the C-API happy */ device_data_t* internalData(); -#ifdef SUBSURFACE_MOBILE - Q_INVOKABLE QStringList getProductListFromVendor(const QString& vendor); - Q_INVOKABLE int getMatchingAddress(const QString &vendor, const QString &product); - - Q_INVOKABLE int getDetectedVendorIndex(); - Q_INVOKABLE int getDetectedProductIndex(const QString ¤tVendorText); -#else QStringList getProductListFromVendor(const QString& vendor); int getMatchingAddress(const QString &vendor, const QString &product); int getDetectedVendorIndex(); int getDetectedProductIndex(const QString ¤tVendorText); -#endif // SUBSURFACE_MOBILE -#ifdef SUBSURFACE_MOBILE -public slots: void setDeviceId(int deviceId); void setDiveId(int diveId); -#else -public: -#endif // SUBSURFACE_MOBILE void setVendor(const QString& vendor); void setProduct(const QString& product); void setDevName(const QString& devName); @@ -91,9 +60,6 @@ private: class DownloadThread : public QThread { Q_OBJECT -#ifdef SUBSURFACE_MOBILE - Q_PROPERTY(DCDeviceData* deviceData MEMBER m_data) -#endif // SUBSURFACE_MOBILE public: DownloadThread(); |