23 #include <QDBusConnection>
32 QObject::connect(&m_watcher, &QDBusServiceWatcher::serviceUnregistered,
34 m_watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
35 m_watcher.setConnection(QDBusConnection::sessionBus());
44 MH_DEBUG() <<
"Client died:" << serviceName;
45 for (
int i = 0; i < m_clients.count(); i++) {
46 const media::Player::Client &client = m_clients[i];
47 if (serviceName == client.name) {
48 notifyClientDeath(client);
49 m_clients.removeAt(i);
56 const media::Player::Client &client)
58 MH_DEBUG() <<
"Watching for client name" << client.name;
59 for (
const media::Player::Client &c: m_clients) {
60 if (client == c)
return;
62 m_clients.append(client);
64 m_watcher.addWatchedService(client.name);