bearer/qnetworkconfigmanager_p.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9static QFactoryLoader *loader() { static QGlobalStatic<QFactoryLoader > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QFactoryLoader *x = new QFactoryLoader ("org.qt-project.Qt.QBearerEngineFactoryInterface", QLatin1String("/bearer")); if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QFactoryLoader > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); }
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:14
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
partially evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
10 -
11 -
12 -
13QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() -
14 : QObject(), pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) -
15{ -
16 qRegisterMetaType<QNetworkConfiguration>(); -
17 qRegisterMetaType<QNetworkConfigurationPrivatePointer>(); -
18}
executed: }
Execution Count:14
14
19 -
20void QNetworkConfigurationManagerPrivate::initialize() -
21{ -
22 -
23 bearerThread = new QThread(); -
24 bearerThread->setObjectName(QString::fromUtf8("" "bearerThread" "", sizeof("bearerThread") - 1)); -
25 -
26 bearerThread->moveToThread(QCoreApplicationPrivate::mainThread()); -
27 moveToThread(bearerThread); -
28 bearerThread->start(); -
29 updateConfigurations(); -
30}
executed: }
Execution Count:14
14
31 -
32QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate() -
33{ -
34 QMutexLocker locker(&mutex); -
35 -
36 qDeleteAll(sessionEngines); -
37 if (bearerThread)
partially evaluated: bearerThread
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
38 bearerThread->quit();
executed: bearerThread->quit();
Execution Count:14
14
39}
executed: }
Execution Count:14
14
40 -
41void QNetworkConfigurationManagerPrivate::cleanup() -
42{ -
43 QThread* thread = bearerThread; -
44 deleteLater(); -
45 if (thread->wait(5000))
partially evaluated: thread->wait(5000)
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
46 delete thread;
executed: delete thread;
Execution Count:14
14
47}
executed: }
Execution Count:14
14
48 -
49QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration() const -
50{ -
51 QMutexLocker locker(&mutex); -
52 -
53 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
54 QNetworkConfigurationPrivatePointer ptr = engine->defaultConfiguration(); -
55 if (ptr) {
partially evaluated: ptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
0-13
56 QNetworkConfiguration config; -
57 config.d = ptr; -
58 return config;
never executed: return config;
0
59 } -
60 }
executed: }
Execution Count:13
13
61 -
62 -
63 -
64 -
65 QNetworkConfigurationPrivatePointer defaultConfiguration; -
66 -
67 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
68 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it; -
69 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator end; -
70 -
71 QMutexLocker locker(&engine->mutex); -
72 -
73 for (it = engine->snapConfigurations.begin(), -
74 end = engine->snapConfigurations.end(); it != end; ++it) {
partially evaluated: it != end
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
0-13
75 QNetworkConfigurationPrivatePointer ptr = it.value(); -
76 -
77 QMutexLocker configLocker(&ptr->mutex); -
78 -
79 if ((ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
never evaluated: (ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active
0
80 QNetworkConfiguration config; -
81 config.d = ptr; -
82 return config;
never executed: return config;
0
83 } else if (!defaultConfiguration) {
never evaluated: !defaultConfiguration
0
84 if ((ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered)
never evaluated: (ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered
0
85 defaultConfiguration = ptr;
never executed: defaultConfiguration = ptr;
0
86 }
never executed: }
0
87 } -
88 }
executed: }
Execution Count:13
13
89 -
90 -
91 if (defaultConfiguration) {
partially evaluated: defaultConfiguration
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
0-13
92 QNetworkConfiguration config; -
93 config.d = defaultConfiguration; -
94 return config;
never executed: return config;
0
95 } -
96 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
97 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it; -
98 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator end; -
99 -
100 QMutexLocker locker(&engine->mutex); -
101 -
102 for (it = engine->accessPointConfigurations.begin(), -
103 end = engine->accessPointConfigurations.end(); it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:13
13-52
104 QNetworkConfigurationPrivatePointer ptr = it.value(); -
105 -
106 QMutexLocker configLocker(&ptr->mutex); -
107 QNetworkConfiguration::BearerType bearerType = ptr->bearerType; -
108 -
109 if ((ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered) {
evaluated: (ptr->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:13
13-39
110 if (!defaultConfiguration) {
evaluated: !defaultConfiguration
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:26
13-26
111 defaultConfiguration = ptr; -
112 } else {
executed: }
Execution Count:13
13
113 QMutexLocker defaultConfigLocker(&defaultConfiguration->mutex); -
114 -
115 if (defaultConfiguration->state == ptr->state) {
partially evaluated: defaultConfiguration->state == ptr->state
TRUEFALSE
yes
Evaluation Count:26
no
Evaluation Count:0
0-26
116 switch (defaultConfiguration->bearerType) { -
117 case QNetworkConfiguration::BearerEthernet: -
118 -
119 break;
executed: break;
Execution Count:26
26
120 case QNetworkConfiguration::BearerWLAN: -
121 -
122 defaultConfiguration = ptr; -
123 break;
never executed: break;
0
124 default: -
125 -
126 if (bearerType == QNetworkConfiguration::BearerEthernet ||
never evaluated: bearerType == QNetworkConfiguration::BearerEthernet
0
127 bearerType == QNetworkConfiguration::BearerWLAN) {
never evaluated: bearerType == QNetworkConfiguration::BearerWLAN
0
128 defaultConfiguration = ptr; -
129 }
never executed: }
0
130 }
never executed: }
0
131 } else {
executed: }
Execution Count:26
26
132 -
133 if ((defaultConfiguration->state & QNetworkConfiguration::Active) != 0
134 QNetworkConfiguration::Active) {
never evaluated: (defaultConfiguration->state & QNetworkConfiguration::Active) != QNetworkConfiguration::Active
0
135 defaultConfiguration = ptr; -
136 }
never executed: }
0
137 }
never executed: }
0
138 } -
139 } -
140 }
executed: }
Execution Count:52
52
141 }
executed: }
Execution Count:13
13
142 -
143 -
144 if (defaultConfiguration) {
partially evaluated: defaultConfiguration
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
145 QNetworkConfiguration config; -
146 config.d = defaultConfiguration; -
147 return config;
executed: return config;
Execution Count:13
13
148 } -
149 -
150 return QNetworkConfiguration();
never executed: return QNetworkConfiguration();
0
151} -
152 -
153QList<QNetworkConfiguration> QNetworkConfigurationManagerPrivate::allConfigurations(QNetworkConfiguration::StateFlags filter) const -
154{ -
155 QList<QNetworkConfiguration> result; -
156 -
157 QMutexLocker locker(&mutex); -
158 -
159 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
160 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it; -
161 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator end; -
162 -
163 QMutexLocker locker(&engine->mutex); -
164 -
165 -
166 for (it = engine->accessPointConfigurations.begin(), -
167 end = engine->accessPointConfigurations.end(); it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:108
yes
Evaluation Count:27
27-108
168 QNetworkConfigurationPrivatePointer ptr = it.value(); -
169 -
170 QMutexLocker configLocker(&ptr->mutex); -
171 -
172 if ((ptr->state & filter) == filter) {
evaluated: (ptr->state & filter) == filter
TRUEFALSE
yes
Evaluation Count:95
yes
Evaluation Count:13
13-95
173 QNetworkConfiguration pt; -
174 pt.d = ptr; -
175 result << pt; -
176 }
executed: }
Execution Count:95
95
177 }
executed: }
Execution Count:108
108
178 -
179 -
180 for (it = engine->snapConfigurations.begin(), -
181 end = engine->snapConfigurations.end(); it != end; ++it) {
partially evaluated: it != end
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
182 QNetworkConfigurationPrivatePointer ptr = it.value(); -
183 -
184 QMutexLocker configLocker(&ptr->mutex); -
185 -
186 if ((ptr->state & filter) == filter) {
never evaluated: (ptr->state & filter) == filter
0
187 QNetworkConfiguration pt; -
188 pt.d = ptr; -
189 result << pt; -
190 }
never executed: }
0
191 }
never executed: }
0
192 }
executed: }
Execution Count:27
27
193 -
194 return result;
executed: return result;
Execution Count:27
27
195} -
196 -
197QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIdentifier(const QString &identifier) const -
198{ -
199 QNetworkConfiguration item; -
200 -
201 QMutexLocker locker(&mutex); -
202 -
203 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
204 QMutexLocker locker(&engine->mutex); -
205 -
206 if (engine->accessPointConfigurations.contains(identifier))
evaluated: engine->accessPointConfigurations.contains(identifier)
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:1
1-4
207 item.d = engine->accessPointConfigurations[identifier];
executed: item.d = engine->accessPointConfigurations[identifier];
Execution Count:4
4
208 else if (engine->snapConfigurations.contains(identifier))
partially evaluated: engine->snapConfigurations.contains(identifier)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
209 item.d = engine->snapConfigurations[identifier];
never executed: item.d = engine->snapConfigurations[identifier];
0
210 else if (engine->userChoiceConfigurations.contains(identifier))
partially evaluated: engine->userChoiceConfigurations.contains(identifier)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
211 item.d = engine->userChoiceConfigurations[identifier];
never executed: item.d = engine->userChoiceConfigurations[identifier];
0
212 else -
213 continue;
executed: continue;
Execution Count:1
1
214 -
215 return item;
executed: return item;
Execution Count:4
4
216 } -
217 -
218 return item;
executed: return item;
Execution Count:1
1
219} -
220 -
221bool QNetworkConfigurationManagerPrivate::isOnline() const -
222{ -
223 QMutexLocker locker(&mutex); -
224 -
225 return !onlineConfigurations.isEmpty();
executed: return !onlineConfigurations.isEmpty();
Execution Count:1
1
226} -
227 -
228QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::capabilities() const -
229{ -
230 QMutexLocker locker(&mutex); -
231 -
232 QNetworkConfigurationManager::Capabilities capFlags; -
233 -
234 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
235 capFlags |= engine->capabilities();
executed: capFlags |= engine->capabilities();
Execution Count:84
84
236 -
237 return capFlags;
executed: return capFlags;
Execution Count:84
84
238} -
239 -
240void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurationPrivatePointer ptr) -
241{ -
242 QMutexLocker locker(&mutex); -
243 -
244 if (!firstUpdate) {
partially evaluated: !firstUpdate
TRUEFALSE
yes
Evaluation Count:56
no
Evaluation Count:0
0-56
245 QNetworkConfiguration item; -
246 item.d = ptr; -
247 configurationAdded(item); -
248 }
executed: }
Execution Count:56
56
249 -
250 ptr->mutex.lock(); -
251 if (ptr->state == QNetworkConfiguration::Active) {
evaluated: ptr->state == QNetworkConfiguration::Active
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:14
14-42
252 ptr->mutex.unlock(); -
253 onlineConfigurations.insert(ptr->id); -
254 if (!firstUpdate && onlineConfigurations.count() == 1)
partially evaluated: !firstUpdate
TRUEFALSE
yes
Evaluation Count:42
no
Evaluation Count:0
evaluated: onlineConfigurations.count() == 1
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:28
0-42
255 onlineStateChanged(true);
executed: onlineStateChanged(true);
Execution Count:14
14
256 } else {
executed: }
Execution Count:42
42
257 ptr->mutex.unlock(); -
258 }
executed: }
Execution Count:14
14
259} -
260 -
261void QNetworkConfigurationManagerPrivate::configurationRemoved(QNetworkConfigurationPrivatePointer ptr) -
262{ -
263 QMutexLocker locker(&mutex); -
264 -
265 ptr->mutex.lock(); -
266 ptr->isValid = false; -
267 ptr->mutex.unlock(); -
268 -
269 if (!firstUpdate) {
never evaluated: !firstUpdate
0
270 QNetworkConfiguration item; -
271 item.d = ptr; -
272 configurationRemoved(item); -
273 }
never executed: }
0
274 -
275 onlineConfigurations.remove(ptr->id); -
276 if (!firstUpdate && onlineConfigurations.isEmpty())
never evaluated: !firstUpdate
never evaluated: onlineConfigurations.isEmpty()
0
277 onlineStateChanged(false);
never executed: onlineStateChanged(false);
0
278}
never executed: }
0
279 -
280void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigurationPrivatePointer ptr) -
281{ -
282 QMutexLocker locker(&mutex); -
283 -
284 if (!firstUpdate) {
never evaluated: !firstUpdate
0
285 QNetworkConfiguration item; -
286 item.d = ptr; -
287 configurationChanged(item); -
288 }
never executed: }
0
289 -
290 bool previous = !onlineConfigurations.isEmpty(); -
291 -
292 ptr->mutex.lock(); -
293 if (ptr->state == QNetworkConfiguration::Active)
never evaluated: ptr->state == QNetworkConfiguration::Active
0
294 onlineConfigurations.insert(ptr->id);
never executed: onlineConfigurations.insert(ptr->id);
0
295 else -
296 onlineConfigurations.remove(ptr->id);
never executed: onlineConfigurations.remove(ptr->id);
0
297 ptr->mutex.unlock(); -
298 -
299 bool online = !onlineConfigurations.isEmpty(); -
300 -
301 if (!firstUpdate && online != previous)
never evaluated: !firstUpdate
never evaluated: online != previous
0
302 onlineStateChanged(online);
never executed: onlineStateChanged(online);
0
303}
never executed: }
0
304 -
305void QNetworkConfigurationManagerPrivate::updateConfigurations() -
306{ -
307 -
308 typedef QMultiMap<int, QString> PluginKeyMap; -
309 typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator; -
310 -
311 QMutexLocker locker(&mutex); -
312 -
313 if (firstUpdate) {
evaluated: firstUpdate
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:68
14-68
314 if (qobject_cast<QBearerEngine *>(sender()))
partially evaluated: qobject_cast<QBearerEngine *>(sender())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14
0-14
315 return;
never executed: return;
0
316 -
317 updating = false; -
318 -
319 -
320 QBearerEngine *generic = 0; -
321 QFactoryLoader *l = loader(); -
322 const PluginKeyMap keyMap = l->keyMap(); -
323 const PluginKeyMapConstIterator cend = keyMap.constEnd(); -
324 QStringList addedEngines; -
325 for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
evaluated: it != cend
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:14
14-42
326 const QString &key = it.value(); -
327 if (addedEngines.contains(key))
partially evaluated: addedEngines.contains(key)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42
0-42
328 continue;
never executed: continue;
0
329 -
330 addedEngines.append(key); -
331 if (QBearerEngine *engine = qLoadPlugin<QBearerEngine, QBearerEnginePlugin>(l, key)) {
evaluated: QBearerEngine *engine = qLoadPlugin<QBearerEngine, QBearerEnginePlugin>(l, key)
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:28
14-28
332 if (key == QLatin1String("generic"))
partially evaluated: key == QLatin1String("generic")
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
333 generic = engine;
executed: generic = engine;
Execution Count:14
14
334 else -
335 sessionEngines.append(engine);
never executed: sessionEngines.append(engine);
0
336 -
337 engine->moveToThread(bearerThread); -
338 -
339 connect(engine, "2""updateCompleted()", -
340 this, "1""updateConfigurations()", -
341 Qt::QueuedConnection); -
342 connect(engine, "2""configurationAdded(QNetworkConfigurationPrivatePointer)", -
343 this, "1""configurationAdded(QNetworkConfigurationPrivatePointer)", -
344 Qt::QueuedConnection); -
345 connect(engine, "2""configurationRemoved(QNetworkConfigurationPrivatePointer)", -
346 this, "1""configurationRemoved(QNetworkConfigurationPrivatePointer)", -
347 Qt::QueuedConnection); -
348 connect(engine, "2""configurationChanged(QNetworkConfigurationPrivatePointer)", -
349 this, "1""configurationChanged(QNetworkConfigurationPrivatePointer)", -
350 Qt::QueuedConnection); -
351 }
executed: }
Execution Count:14
14
352 }
executed: }
Execution Count:42
42
353 -
354 if (generic)
partially evaluated: generic
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
355 sessionEngines.append(generic);
executed: sessionEngines.append(generic);
Execution Count:14
14
356 -
357 }
executed: }
Execution Count:14
14
358 -
359 QBearerEngine *engine = qobject_cast<QBearerEngine *>(sender()); -
360 if (engine && !updatingEngines.isEmpty())
evaluated: engine
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:14
evaluated: !updatingEngines.isEmpty()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:52
14-68
361 updatingEngines.remove(engine);
executed: updatingEngines.remove(engine);
Execution Count:16
16
362 -
363 if (updating && updatingEngines.isEmpty()) {
evaluated: updating
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:66
partially evaluated: updatingEngines.isEmpty()
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-66
364 updating = false; -
365 configurationUpdateComplete(); -
366 }
executed: }
Execution Count:16
16
367 -
368 if (engine && !pollingEngines.isEmpty()) {
evaluated: engine
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:14
evaluated: !pollingEngines.isEmpty()
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:30
14-68
369 pollingEngines.remove(engine); -
370 if (pollingEngines.isEmpty())
partially evaluated: pollingEngines.isEmpty()
TRUEFALSE
yes
Evaluation Count:38
no
Evaluation Count:0
0-38
371 startPolling();
executed: startPolling();
Execution Count:38
38
372 }
executed: }
Execution Count:38
38
373 -
374 if (firstUpdate) {
evaluated: firstUpdate
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:68
14-68
375 firstUpdate = false; -
376 QList<QBearerEngine*> enginesToInitialize = sessionEngines; -
377 locker.unlock(); -
378 for (QForeachContainer<__typeof__(enginesToInitialize)> _container_(enginesToInitialize); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine* engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
379 QMetaObject::invokeMethod(engine, "initialize", Qt::BlockingQueuedConnection); -
380 }
executed: }
Execution Count:14
14
381 }
executed: }
Execution Count:14
14
382}
executed: }
Execution Count:82
82
383 -
384void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() -
385{ -
386 QMutexLocker locker(&mutex); -
387 -
388 if (sessionEngines.isEmpty()) {
partially evaluated: sessionEngines.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
389 configurationUpdateComplete(); -
390 return;
never executed: return;
0
391 } -
392 -
393 updating = true; -
394 -
395 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
396 updatingEngines.insert(engine); -
397 QMetaObject::invokeMethod(engine, "requestUpdate"); -
398 }
executed: }
Execution Count:16
16
399}
executed: }
Execution Count:16
16
400 -
401QList<QBearerEngine *> QNetworkConfigurationManagerPrivate::engines() const -
402{ -
403 QMutexLocker locker(&mutex); -
404 -
405 return sessionEngines;
executed: return sessionEngines;
Execution Count:76
76
406} -
407 -
408void QNetworkConfigurationManagerPrivate::startPolling() -
409{ -
410 QMutexLocker locker(&mutex); -
411 -
412 if(!pollTimer) {
evaluated: !pollTimer
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:46
14-46
413 pollTimer = new QTimer(this); -
414 pollTimer->setInterval(10000); -
415 pollTimer->setSingleShot(true); -
416 connect(pollTimer, "2""timeout()", this, "1""pollEngines()"); -
417 }
executed: }
Execution Count:14
14
418 -
419 if(pollTimer->isActive())
evaluated: pollTimer->isActive()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:53
7-53
420 return;
executed: return;
Execution Count:7
7
421 -
422 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
423 if (engine->requiresPolling() && (forcedPolling || engine->configurationsInUse())) {
partially evaluated: engine->requiresPolling()
TRUEFALSE
yes
Evaluation Count:53
no
Evaluation Count:0
evaluated: forcedPolling
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:6
evaluated: engine->configurationsInUse()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
0-53
424 pollTimer->start(); -
425 break;
executed: break;
Execution Count:49
49
426 } -
427 }
executed: }
Execution Count:4
4
428}
executed: }
Execution Count:53
53
429 -
430void QNetworkConfigurationManagerPrivate::pollEngines() -
431{ -
432 QMutexLocker locker(&mutex); -
433 -
434 for (QForeachContainer<__typeof__(sessionEngines)> _container_(sessionEngines); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QBearerEngine *engine = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
435 if (engine->requiresPolling() && (forcedPolling || engine->configurationsInUse())) {
partially evaluated: engine->requiresPolling()
TRUEFALSE
yes
Evaluation Count:38
no
Evaluation Count:0
evaluated: forcedPolling
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:2
partially evaluated: engine->configurationsInUse()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-38
436 pollingEngines.insert(engine); -
437 QMetaObject::invokeMethod(engine, "requestUpdate"); -
438 }
executed: }
Execution Count:38
38
439 }
executed: }
Execution Count:38
38
440}
executed: }
Execution Count:38
38
441 -
442void QNetworkConfigurationManagerPrivate::enablePolling() -
443{ -
444 QMutexLocker locker(&mutex); -
445 -
446 ++forcedPolling; -
447 -
448 if (forcedPolling == 1)
evaluated: forcedPolling == 1
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:85
22-85
449 QMetaObject::invokeMethod(this, "startPolling");
executed: QMetaObject::invokeMethod(this, "startPolling");
Execution Count:22
22
450}
executed: }
Execution Count:107
107
451 -
452void QNetworkConfigurationManagerPrivate::disablePolling() -
453{ -
454 QMutexLocker locker(&mutex); -
455 -
456 --forcedPolling; -
457}
executed: }
Execution Count:107
107
458 -
459 -
460 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial