From f5adbe566235a0b9b7ea0ab978d89aebef8fc8ec Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Tue, 30 May 2017 12:54:41 +0200 Subject: Use #if defined() instead of #if qtcreator (4.3.0) got confused whether BT_SUPPORT was defined. Using work as expected. Signed-off-by: Jan Mulder --- mobile-widgets/qmlmanager.cpp | 8 ++++---- mobile-widgets/qmlmanager.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 9a75fca9e..671fdf7b4 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -89,7 +89,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), m_credentialStatus(UNKNOWN), alreadySaving(false) { -#if BT_SUPPORT +#if defined(BT_SUPPORT) if (localBtDevice.isValid()) { localBtDevice.powerOn(); QString localDeviceName = "localDevice " + localBtDevice.name() + " is valid, starting discovery"; @@ -203,7 +203,7 @@ void QMLManager::mergeLocalRepo() process_dives(true, false); } -#if BT_SUPPORT +#if defined(BT_SUPPORT) extern void addBtUuid(QBluetoothUuid uuid); @@ -237,7 +237,7 @@ void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device) int QMLManager::getVendorIndex() { -#if BT_SUPPORT +#if defined(BT_SUPPORT) if (!btDCs.isEmpty()) { qDebug() << "getVendorIdx" << btDCs.first().vendorIdx; return btDCs.first().vendorIdx; @@ -248,7 +248,7 @@ int QMLManager::getVendorIndex() int QMLManager::getProductIndex() { -#if BT_SUPPORT +#if defined(BT_SUPPORT) if (!btDCs.isEmpty()) { qDebug() << "getProductIdx" << btDCs.first().productIdx; return btDCs.first().productIdx; diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 7e1c3b78b..e21b93d07 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -7,7 +7,7 @@ #include #include #include -#if BT_SUPPORT +#if defined(BT_SUPPORT) #include #include #include @@ -122,7 +122,7 @@ public: Q_INVOKABLE int getVendorIndex(); Q_INVOKABLE int getProductIndex(); Q_INVOKABLE QString getBtAddress(); -#if BT_SUPPORT +#if defined(BT_SUPPORT) void btDeviceDiscovered(const QBluetoothDeviceInfo &device); #endif @@ -207,7 +207,7 @@ private: bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth); bool currentGitLocalOnly; bool m_showPin; -#if BT_SUPPORT +#if defined(BT_SUPPORT) QBluetoothLocalDevice localBtDevice; QBluetoothDeviceDiscoveryAgent *discoveryAgent; struct btVendorProduct { -- cgit v1.2.3-70-g09d2