-
- connect(this, SIGNAL(toolTipChanged(QString, QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
- connect(this, SIGNAL(animationEnabledChanged(bool)), _statusNotifierItemDBus, SIGNAL(NewAttentionIcon()));
-
- QDBusServiceWatcher *watcher = new QDBusServiceWatcher(_statusNotifierWatcherServiceName,
- QDBusConnection::sessionBus(),
- QDBusServiceWatcher::WatchForOwnerChange,
- this);
- connect(watcher, SIGNAL(serviceOwnerChanged(QString, QString, QString)), SLOT(serviceChange(QString, QString, QString)));
-
- setMode(StatusNotifier);
-
- _notificationsClient = new org::freedesktop::Notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications",
- QDBusConnection::sessionBus(), this);
-
- connect(_notificationsClient, SIGNAL(NotificationClosed(uint, uint)), SLOT(notificationClosed(uint, uint)));
- connect(_notificationsClient, SIGNAL(ActionInvoked(uint, QString)), SLOT(notificationInvoked(uint, QString)));
+ connect(this, &StatusNotifierItem::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewIcon);
+ connect(this, &StatusNotifierItem::currentIconNameChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewAttentionIcon);
+ connect(this, &StatusNotifierItem::toolTipChanged, _statusNotifierItemDBus, &StatusNotifierItemDBus::NewToolTip);
+
+ // Service watcher to keep track of the StatusNotifierWatcher service
+ _serviceWatcher = new QDBusServiceWatcher(kSniWatcherService, QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
+ connect(_serviceWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &StatusNotifierItem::serviceChange);
+
+ // Client instance for StatusNotifierWatcher
+ _statusNotifierWatcher = new org::kde::StatusNotifierWatcher(kSniWatcherService, kSniWatcherPath, QDBusConnection::sessionBus(), this);
+ connect(_statusNotifierWatcher,
+ &OrgKdeStatusNotifierWatcherInterface::StatusNotifierHostRegistered,
+ this,
+ &StatusNotifierItem::checkForRegisteredHosts);
+ connect(_statusNotifierWatcher,
+ &OrgKdeStatusNotifierWatcherInterface::StatusNotifierHostUnregistered,
+ this,
+ &StatusNotifierItem::checkForRegisteredHosts);
+
+ // Client instance for notifications
+ _notificationsClient = new org::freedesktop::Notifications(kXdgNotificationsService,
+ kXdgNotificationsPath,
+ QDBusConnection::sessionBus(),
+ this);
+ connect(_notificationsClient, &OrgFreedesktopNotificationsInterface::NotificationClosed, this, &StatusNotifierItem::notificationClosed);
+ connect(_notificationsClient, &OrgFreedesktopNotificationsInterface::ActionInvoked, this, &StatusNotifierItem::notificationInvoked);