Changeset bec5f3c in subsurface


Ignore:
Timestamp:
Jul 12, 2017, 4:13:25 AM (8 days ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
2c111bb
Parents:
0c5f373e
Message:

BT support: track if Bluetooth is available

Signed-off-by: Dirk Hohndel <dirk@…>

Location:
core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/btdiscovery.cpp

    r345e063 rbec5f3c  
    6262                btPairedDevices.clear();
    6363                qDebug() <<  "localDevice " + localBtDevice.name() + " is valid, starting discovery";
     64                m_btValid = true;
    6465#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
    6566                discoveryAgent = new QBluetoothDeviceDiscoveryAgent(this);
     
    8586        } else {
    8687                qDebug() << "localBtDevice isn't valid";
     88                m_btValid = false;
    8789        }
    8890#endif
     
    174176{
    175177        return btDCs;
     178}
     179
     180bool BTDiscovery::btAvailable() const
     181{
     182        return m_btValid;
     183
    176184}
    177185
  • core/btdiscovery.h

    r345e063 rbec5f3c  
    4141        void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
    4242        void btDeviceDiscoveredMain(const btPairedDevice &device);
     43        bool btAvailable() const;
    4344#if defined(Q_OS_ANDROID)
    4445        void getBluetoothDevices();
     
    4849private:
    4950        static BTDiscovery *m_instance;
     51        bool m_btValid;
    5052#if defined(BT_SUPPORT)
    5153        QList<struct btVendorProduct> btDCs;            // recognized DCs
Note: See TracChangeset for help on using the changeset viewer.