mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-01-28 22:01:50 +00:00
[Linux] Implement proper disconnection detection (#95)
* [Linux] Implement proper disconection detection * Only trigger on airpod devices * Remove unused code * [Linux] Fix SegmentedControl text not shown in release build (but debug builds showed text)???
This commit is contained in:
26
linux/BluetoothMonitor.h
Normal file
26
linux/BluetoothMonitor.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef BLUETOOTHMONITOR_H
|
||||
#define BLUETOOTHMONITOR_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
class BluetoothMonitor : public QObject, protected QDBusContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothMonitor(QObject *parent = nullptr);
|
||||
~BluetoothMonitor();
|
||||
|
||||
signals:
|
||||
void deviceConnected(const QString &macAddress);
|
||||
void deviceDisconnected(const QString &macAddress);
|
||||
|
||||
private slots:
|
||||
void onPropertiesChanged(const QString &interface, const QVariantMap &changedProps, const QStringList &invalidatedProps);
|
||||
|
||||
private:
|
||||
QDBusConnection m_dbus;
|
||||
void registerDBusService();
|
||||
};
|
||||
|
||||
#endif // BLUETOOTHMONITOR_H
|
||||
Reference in New Issue
Block a user