+ connect(QtUi::instance(), SIGNAL(iconThemeRefreshed()), this, SLOT(refreshIcons()));
+ refreshIcons();
+
+ // Our own SNI service
+ _statusNotifierItemDBus = new StatusNotifierItemDBus(this);
+ connect(this, SIGNAL(toolTipChanged(QString, QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
+ connect(this, SIGNAL(animationEnabledChanged(bool)), _statusNotifierItemDBus, SIGNAL(NewAttentionIcon()));
+
+ // Service watcher to keep track of the StatusNotifierWatcher service
+ QDBusServiceWatcher *watcher = new QDBusServiceWatcher(kSniWatcherService,
+ QDBusConnection::sessionBus(),
+ QDBusServiceWatcher::WatchForOwnerChange,
+ this);
+ connect(watcher, SIGNAL(serviceOwnerChanged(QString, QString, QString)), SLOT(serviceChange(QString, QString, QString)));
+
+ // Client instance for StatusNotifierWatcher
+ _statusNotifierWatcher = new org::kde::StatusNotifierWatcher(kSniWatcherService,
+ kSniWatcherPath,
+ QDBusConnection::sessionBus(),
+ this);
+ connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostRegistered()), SLOT(checkForRegisteredHosts()));
+ connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostUnregistered()), SLOT(checkForRegisteredHosts()));
+
+ // Client instance for notifications
+ _notificationsClient = new org::freedesktop::Notifications(kXdgNotificationsService,
+ kXdgNotificationsPath,
+ QDBusConnection::sessionBus(),
+ this);
+ connect(_notificationsClient, SIGNAL(NotificationClosed(uint, uint)), SLOT(notificationClosed(uint, uint)));
+ connect(_notificationsClient, SIGNAL(ActionInvoked(uint, QString)), SLOT(notificationInvoked(uint, QString)));
+
+ if (_notificationsClient->isValid()) {
+ QStringList desktopCapabilities = _notificationsClient->GetCapabilities();
+ _notificationsClientSupportsMarkup = desktopCapabilities.contains("body-markup");
+ _notificationsClientSupportsActions = desktopCapabilities.contains("actions");
+ }