diff options
author | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-12-15 17:02:42 +0200 |
---|---|---|
committer | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-12-19 10:03:53 +0000 |
commit | 057921868881295c0128204f2f4e53956b0a3d3c (patch) | |
tree | 9738ecdcca5fc9310b1ee5cfadd13bb5da85d829 /src/bluetoothsettings/bluez/bluetoothdevice_p.cpp | |
parent | 44d7f1865af8a8b4491f2d272f9e8e16f09c741b (diff) |
Use connman with bluetooth only if networksettings are available
Task-number: QTBUG-64693
Change-Id: Id2ce5342a0749d123a499c6c519d5ae2e6c3cae9
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'src/bluetoothsettings/bluez/bluetoothdevice_p.cpp')
-rw-r--r-- | src/bluetoothsettings/bluez/bluetoothdevice_p.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp b/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp index 8850f14..7b29ec9 100644 --- a/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp +++ b/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp @@ -32,8 +32,11 @@ #include "objectmanager_interface.cpp" #include "moc_objectmanager_interface.cpp" #include "device1_interface.h" + +#ifdef USE_CONNMAN_BLUETOOTH #include "connman_technology_interface.h" #include "connmancommon.h" +#endif QT_BEGIN_NAMESPACE @@ -51,9 +54,11 @@ BluetoothDevicePrivate::BluetoothDevicePrivate(BluetoothDevice *parent) : QObjec m_manager = new OrgFreedesktopDBusObjectManagerInterface(QStringLiteral("org.bluez"), QStringLiteral("/"), QDBusConnection::systemBus(), this); +#ifdef USE_CONNMAN_BLUETOOTH m_technology = new NetConnmanTechnologyInterface(QStringLiteral("net.connman"), QStringLiteral("/net/connman/technology/bluetooth"), QDBusConnection::systemBus(), this); +#endif QDBusPendingReply<ManagedObjectList> reply = m_manager->GetManagedObjects(); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, @@ -77,7 +82,9 @@ void BluetoothDevicePrivate::setPowered(const bool& aPowered) if (!m_localDevice) return; +#ifdef USE_CONNMAN_BLUETOOTH m_technology->SetProperty(PropertyPowered, QDBusVariant(QVariant(aPowered))); +#endif if (aPowered) { m_localDevice->powerOn(); |