summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothlocaldevice_p.h
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-10-31 11:05:50 +0100
committerOliver Wolff <oliver.wolff@qt.io>2018-11-15 14:37:30 +0000
commit4821972696716f988b4b92f22a9a552be15c5401 (patch)
treed00c215a5d386a45c3c633ba8a63e1c0194f2e05 /src/bluetooth/qbluetoothlocaldevice_p.h
parentc2b510909dc8839ff6578086051a22e8b21462e3 (diff)
qbluetoothlocaldevice_p.cpp: Make sure d_ptr is initialized
Backends that still use qbluetoothlocaldevce_p.cpp (namely ios and winrt) overload QBluetoothLocalDevicePrivate::isValid. While it does not make a difference for ios (as false is returned if no d_ptr is initialized) local device will be seen as invalid on winrt if there is no d_ptr. Fixes: QTBUG-67090 Change-Id: I82dfa4563be0ed4800f0a8dd2a9ccfc3fe313e3b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 89dbf9a3..98c62151 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_p.h
@@ -208,37 +208,22 @@ private:
void initializeAdapter();
void initializeAdapterBluez5();
};
-#elif defined(QT_WINRT_BLUETOOTH)
+#elif !defined(QT_OSX_BLUETOOTH) // winrt and dummy backend
class QBluetoothLocalDevicePrivate : public QObject
{
public:
- QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *q,
- QBluetoothAddress localAddress = QBluetoothAddress())
- : q_ptr(q)
- {
- Q_UNUSED(localAddress);
- }
-
- ~QBluetoothLocalDevicePrivate()
- {
- }
-
-
- bool isValid() const
+ QBluetoothLocalDevicePrivate(QBluetoothLocalDevice * = nullptr,
+ QBluetoothAddress = QBluetoothAddress())
{
- return true;
}
-private:
- QBluetoothLocalDevice *q_ptr;
-};
-#elif !defined(QT_OSX_BLUETOOTH)
-class QBluetoothLocalDevicePrivate : public QObject
-{
-public:
bool isValid() const
{
+#ifndef QT_WINRT_BLUETOOTH
return false;
+#else
+ return true;
+#endif
}
};
#endif