Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Merge branch 'jb36919' into 'master'
Browse files Browse the repository at this point in the history
[bluez] Check for a null usableAdapter in bluez plugin. Fixes JB#36919

When the manager no longer has a usable adapter, usableAdapterChanged()
is emitted with a null adapter.

See merge request !10
  • Loading branch information
blam committed Nov 26, 2016
2 parents e2ab561 + df1f1af commit d2e5319
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bluez/provider_bluez.cpp
Expand Up @@ -72,10 +72,17 @@ void Bridge::init()

void Bridge::usableAdapterChanged(BluezQt::AdapterPtr adapter)
{
qDebug() << "Found default bluetooth adapter" << adapter->ubi();

adapter_ = adapter;

if (adapter.isNull()) {
static_cast<BlueZ*>(target_)->reset_properties();
devices_.clear();
connected_.clear();
return;
}

qDebug() << "Found default bluetooth adapter" << adapter->ubi();

connect(adapter_.data(), &BluezQt::Adapter::poweredChanged
, [this](bool powered) {
updateProperty("Powered", powered);
Expand Down

0 comments on commit d2e5319

Please sign in to comment.