Changeset View
Changeset View
Standalone View
Standalone View
dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 95 | if (m_statusNotifierWatcher->isValid()) { | |||
---|---|---|---|---|---|
98 | OrgFreedesktopDBusPropertiesInterface propetriesIface(m_statusNotifierWatcher->service(), m_statusNotifierWatcher->path(), m_statusNotifierWatcher->connection()); | 98 | OrgFreedesktopDBusPropertiesInterface propetriesIface(m_statusNotifierWatcher->service(), m_statusNotifierWatcher->path(), m_statusNotifierWatcher->connection()); | ||
99 | 99 | | |||
100 | QDBusPendingReply<QDBusVariant> pendingItems = propetriesIface.Get(m_statusNotifierWatcher->interface(), "RegisteredStatusNotifierItems"); | 100 | QDBusPendingReply<QDBusVariant> pendingItems = propetriesIface.Get(m_statusNotifierWatcher->interface(), "RegisteredStatusNotifierItems"); | ||
101 | 101 | | |||
102 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingItems, this); | 102 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingItems, this); | ||
103 | connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() { | 103 | connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() { | ||
104 | watcher->deleteLater(); | 104 | watcher->deleteLater(); | ||
105 | QDBusReply<QDBusVariant> reply = *watcher; | 105 | QDBusReply<QDBusVariant> reply = *watcher; | ||
106 | QStringList registeredItems = reply.value().variant().toStringList(); | 106 | const QStringList registeredItems = reply.value().variant().toStringList(); | ||
107 | foreach (const QString &service, registeredItems) { | 107 | for (const QString &service : registeredItems) { | ||
108 | newItem(service); | 108 | newItem(service); | ||
109 | } | 109 | } | ||
110 | }); | 110 | }); | ||
111 | 111 | | |||
112 | connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered); | 112 | connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered); | ||
113 | connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered); | 113 | connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered); | ||
114 | 114 | | |||
115 | } else { | 115 | } else { | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |