diff --git a/libs/handler.h b/libs/handler.h --- a/libs/handler.h +++ b/libs/handler.h @@ -127,6 +127,7 @@ Q_SIGNALS: void connectionActivationFailed(const QString &connectionPath, const QString &message); private: + bool m_tmpBluetoothEnabled; bool m_tmpWirelessEnabled; bool m_tmpWwanEnabled; #if WITH_MODEMMANAGER_SUPPORT diff --git a/libs/handler.cpp b/libs/handler.cpp --- a/libs/handler.cpp +++ b/libs/handler.cpp @@ -69,6 +69,7 @@ Handler::Handler(QObject *parent) : QObject(parent) + , m_tmpBluetoothEnabled(false) , m_tmpWirelessEnabled(NetworkManager::isWirelessEnabled()) , m_tmpWwanEnabled(NetworkManager::isWwanEnabled()) { @@ -368,7 +369,9 @@ enableWireless(false); enableWwan(false); } else { - enableBluetooth(true); + if (m_tmpBluetoothEnabled) { + enableBluetooth(true); + } if (m_tmpWirelessEnabled) { enableWireless(true); } @@ -408,7 +411,8 @@ [this, objPath] (QDBusPendingCallWatcher *watcher) { QDBusPendingReply reply = *watcher; if (reply.isValid()) { - m_bluetoothAdapters.insert(objPath, reply.value().toBool()); + m_tmpBluetoothEnabled = reply.value().toBool(); + m_bluetoothAdapters.insert(objPath, m_tmpBluetoothEnabled); QDBusMessage message = QDBusMessage::createMethodCall("org.bluez", objPath, "org.freedesktop.DBus.Properties", "Set"); QList arguments; arguments << QLatin1String("org.bluez.Adapter1");