diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-05-22 14:58:48 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-27 12:59:10 +0200 |
commit | 19f10aae3d333ef6486ea1390998f0674fd4d89e (patch) | |
tree | 716c07b78e68fe76c78bd2a20deed3d8425f0f18 /src/bluetooth/qbluetoothlocaldevice_p.h | |
parent | d4537ea1e887510cce1d42437b92f26b52e30d71 (diff) |
Bluez4: Ensure QBluetoothLocalDevice becomes invalid if adapter disappears
The DBus object disappears when the dongle is removed. Once a
QBluetoothLocalDevice instance is invalid it remains invalid.
The patch further ensures that an invalid instance does not
initiate pairing activitiy.
Last but not least this patch fixes a memory leak in case
a DBus error occurs during the adapter initialization.
Task-number: QTBUG-38399
Change-Id: I2e13e393060c77fab5f79d5451dd6fe9a2a6e3bb
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice_p.h')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h index f00c33bf..66eb366c 100644 --- a/src/bluetooth/qbluetoothlocaldevice_p.h +++ b/src/bluetooth/qbluetoothlocaldevice_p.h @@ -56,6 +56,7 @@ class OrgBluezAdapterInterface; class OrgBluezAgentAdaptor; class OrgBluezDeviceInterface; +class OrgBluezManagerInterface; QT_BEGIN_NAMESPACE class QDBusPendingCallWatcher; @@ -130,6 +131,7 @@ public: QSet<QBluetoothAddress> connectedDevicesSet; OrgBluezAdapterInterface *adapter; OrgBluezAgentAdaptor *agent; + OrgBluezManagerInterface *manager; QList<QBluetoothAddress> connectedDevices() const; @@ -158,6 +160,7 @@ public Q_SLOTS: // METHODS void _q_deviceRemoved(const QDBusObjectPath &device); void _q_devicePropertyChanged(const QString &property, const QDBusVariant &value); bool isValid() const; + void adapterRemoved(const QDBusObjectPath &device); private: void createCache(); |