Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/private/dataenginemanager.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | { | 53 | { | ||
54 | public: | 54 | public: | ||
55 | DataEngineManagerPrivate() | 55 | DataEngineManagerPrivate() | ||
56 | : nullEng(nullptr) | 56 | : nullEng(nullptr) | ||
57 | {} | 57 | {} | ||
58 | 58 | | |||
59 | ~DataEngineManagerPrivate() | 59 | ~DataEngineManagerPrivate() | ||
60 | { | 60 | { | ||
61 | foreach (Plasma::DataEngine *engine, engines) { | 61 | for (Plasma::DataEngine *engine : qAsConst(engines)) { | ||
62 | delete engine; | 62 | delete engine; | ||
63 | } | 63 | } | ||
64 | engines.clear(); | 64 | engines.clear(); | ||
65 | delete nullEng; | 65 | delete nullEng; | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | DataEngine *nullEngine() | 68 | DataEngine *nullEngine() | ||
69 | { | 69 | { | ||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 160 | #ifndef NDEBUG | |||
172 | while (it.hasNext()) { | 172 | while (it.hasNext()) { | ||
173 | it.next(); | 173 | it.next(); | ||
174 | DataEngine *engine = it.value(); | 174 | DataEngine *engine = it.value(); | ||
175 | out << "DataEngine: " << it.key() << ' ' << engine << endl; | 175 | out << "DataEngine: " << it.key() << ' ' << engine << endl; | ||
176 | out << " Claimed # of sources: " << engine->sources().count() << endl; | 176 | out << " Claimed # of sources: " << engine->sources().count() << endl; | ||
177 | out << " Actual # of sources: " << engine->containerDict().count() << endl; | 177 | out << " Actual # of sources: " << engine->containerDict().count() << endl; | ||
178 | out << endl << " Source Details" << endl; | 178 | out << endl << " Source Details" << endl; | ||
179 | 179 | | |||
180 | foreach (DataContainer *dc, engine->containerDict()) { | 180 | const auto lst = engine->containerDict(); | ||
181 | for (DataContainer *dc : lst) { | ||||
181 | out << " * " << dc->objectName() << endl; | 182 | out << " * " << dc->objectName() << endl; | ||
182 | out << " Data count: " << dc->d->data.count() << endl; | 183 | out << " Data count: " << dc->d->data.count() << endl; | ||
183 | out << " Stored: " << dc->isStorageEnabled() << ' ' << endl; | 184 | out << " Stored: " << dc->isStorageEnabled() << ' ' << endl; | ||
184 | const int directs = dc->receivers(SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data))); | 185 | const int directs = dc->receivers(SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data))); | ||
185 | if (directs > 0) { | 186 | if (directs > 0) { | ||
186 | out << " Direction Connections: " << directs << ' ' << endl; | 187 | out << " Direction Connections: " << directs << ' ' << endl; | ||
187 | } | 188 | } | ||
188 | 189 | | |||
189 | const int relays = dc->d->relays.count(); | 190 | const int relays = dc->d->relays.count(); | ||
190 | if (relays > 0) { | 191 | if (relays > 0) { | ||
191 | out << " Relays: " << dc->d->relays.count() << endl; | 192 | out << " Relays: " << dc->d->relays.count() << endl; | ||
192 | QString times; | 193 | QString times; | ||
193 | foreach (SignalRelay *relay, dc->d->relays) { | 194 | for (SignalRelay *relay : qAsConst(dc->d->relays)) { | ||
194 | times.append(QLatin1Char(' ') + QString::number(relay->m_interval)); | 195 | times.append(QLatin1Char(' ') + QString::number(relay->m_interval)); | ||
195 | } | 196 | } | ||
196 | out << " Relay Timeouts: " << times << ' ' << endl; | 197 | out << " Relay Timeouts: " << times << ' ' << endl; | ||
197 | } | 198 | } | ||
198 | } | 199 | } | ||
199 | 200 | | |||
200 | out << endl << "-----" << endl; | 201 | out << endl << "-----" << endl; | ||
201 | } | 202 | } | ||
202 | out << endl << endl; | 203 | out << endl << endl; | ||
203 | #endif | 204 | #endif | ||
204 | // killTimer(event->timerId()); | 205 | // killTimer(event->timerId()); | ||
205 | } | 206 | } | ||
206 | 207 | | |||
207 | } // namespace Plasma | 208 | } // namespace Plasma | ||
208 | 209 | | |||
209 | #include "moc_dataenginemanager_p.cpp" | 210 | #include "moc_dataenginemanager_p.cpp" |