QML UI: move BT handling into core code

This shouldn't be part of the UI (qmlmanager), but part of our
overall handling of dive computers and BT devices.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-05 19:41:57 -07:00
parent 3b993fbaad
commit b14a522f4f
8 changed files with 305 additions and 199 deletions

View file

@ -16,6 +16,7 @@
#include <QAndroidJniObject>
#endif
#include "core/btdiscovery.h"
#include "core/gpslocation.h"
#include "qt-models/divelistmodel.h"
@ -121,18 +122,6 @@ public:
QStringList cylinderInit() const;
bool showPin() const;
void setShowPin(bool enable);
Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor);
Q_INVOKABLE int getVendorIndex();
Q_INVOKABLE int getProductIndex();
Q_INVOKABLE QString getBtAddress();
#if defined(BT_SUPPORT)
struct btPairedDevice {
QBluetoothAddress address;
QString name;
};
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
void getBluetoothDevices();
#endif
public slots:
void applicationStateChanged(Qt::ApplicationState state);
@ -216,22 +205,6 @@ private:
bool currentGitLocalOnly;
bool m_showPin;
#if defined(Q_OS_ANDROID)
bool checkException(const char* method, const QAndroidJniObject* obj);
#endif
#if defined(BT_SUPPORT)
QList<struct btPairedDevice> btPairedDevices;
QBluetoothLocalDevice localBtDevice;
QBluetoothDeviceDiscoveryAgent *discoveryAgent;
struct btVendorProduct {
QBluetoothDeviceInfo btdi;
int vendorIdx;
int productIdx;
};
QList<struct btVendorProduct> btDCs;
#endif
signals:
void cloudUserNameChanged();
void cloudPasswordChanged();