+void StatusNotifierItem::registerToDaemon()
+{
+ if (!_statusNotifierWatcher) {
+ _statusNotifierWatcher = new org::kde::StatusNotifierWatcher(_statusNotifierWatcherServiceName,
+ "/StatusNotifierWatcher",
+ QDBusConnection::sessionBus());
+ connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostRegistered()), SLOT(checkForRegisteredHosts()));
+ connect(_statusNotifierWatcher, SIGNAL(StatusNotifierHostUnregistered()), SLOT(checkForRegisteredHosts()));
+ }
+ if (_statusNotifierWatcher->isValid()
+ && _statusNotifierWatcher->property("ProtocolVersion").toInt() == _protocolVersion) {
+ _statusNotifierWatcher->RegisterStatusNotifierItem(_statusNotifierItemDBus->service());
+ checkForRegisteredHosts();
+ }
+ else {
+ //qDebug() << "StatusNotifierWatcher not reachable!";
+ setMode(Legacy);
+ }