[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:
Tim Gromeyer
2025-04-14 23:25:02 +02:00
committed by GitHub
parent b1811770a3
commit e384840bcc
5 changed files with 156 additions and 108 deletions

26
linux/BluetoothMonitor.h Normal file
View 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