| 119 | } |
| 120 | |
| 121 | OrientationSensor::OrientationSensor() |
| 122 | { |
| 123 | m_watcher = std::make_unique<QDBusServiceWatcher>(serviceName(), QDBusConnection::systemBus(), QDBusServiceWatcher::WatchForOwnerChange); |
| 124 | connect(m_watcher.get(), &QDBusServiceWatcher::serviceRegistered, this, &OrientationSensor::onServiceRegistered); |
| 125 | connect(m_watcher.get(), &QDBusServiceWatcher::serviceUnregistered, this, &OrientationSensor::onServiceUnregistered); |
| 126 | |
| 127 | m_properties = std::make_unique<OrgFreedesktopDBusPropertiesInterface>(serviceName(), objectPath(), QDBusConnection::systemBus()); |
| 128 | connect(m_properties.get(), &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &OrientationSensor::onPropertiesChanged); |
| 129 | |
| 130 | if (QDBusConnection::systemBus().interface()->isServiceRegistered(serviceName())) { |
| 131 | onServiceRegistered(); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | OrientationSensor::~OrientationSensor() |
| 136 | { |
nothing calls this directly
no test coverage detected