bearer/qnetworkconfigmanager.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8static QBasicAtomicPointer<QNetworkConfigurationManagerPrivate> connManager_ptr; -
9 -
10static void connManager_cleanup() -
11{ -
12 -
13 QNetworkConfigurationManagerPrivate *cmp = connManager_ptr.fetchAndStoreAcquire(0); -
14 if (cmp)
partially evaluated: cmp
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
15 cmp->cleanup();
executed: cmp->cleanup();
Execution Count:14
14
16}
executed: }
Execution Count:14
14
17 -
18void QNetworkConfigurationManagerPrivate::addPostRoutine() -
19{ -
20 qAddPostRoutine(connManager_cleanup); -
21}
executed: }
Execution Count:14
14
22 -
23QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate() -
24{ -
25 QNetworkConfigurationManagerPrivate *ptr = connManager_ptr.loadAcquire(); -
26 if (!ptr) {
evaluated: !ptr
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:422
14-422
27 static QBasicMutex connManager_mutex; -
28 QMutexLocker locker(&connManager_mutex); -
29 if (!(ptr = connManager_ptr.loadAcquire())) {
partially evaluated: !(ptr = connManager_ptr.loadAcquire())
TRUEFALSE
yes
Evaluation Count:14
no
Evaluation Count:0
0-14
30 ptr = new QNetworkConfigurationManagerPrivate; -
31 -
32 if (QCoreApplicationPrivate::mainThread() == QThread::currentThread()) {
evaluated: QCoreApplicationPrivate::mainThread() == QThread::currentThread()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1
1-13
33 -
34 ptr->addPostRoutine(); -
35 ptr->initialize(); -
36 } else {
executed: }
Execution Count:13
13
37 -
38 QObject *obj = new QObject; -
39 QObject::connect(obj, "2""destroyed()", ptr, "1""addPostRoutine()", Qt::DirectConnection); -
40 ptr->initialize(); -
41 obj->moveToThread(QCoreApplicationPrivate::mainThread()); -
42 obj->deleteLater(); -
43 }
executed: }
Execution Count:1
1
44 -
45 connManager_ptr.storeRelease(ptr); -
46 }
executed: }
Execution Count:14
14
47 }
executed: }
Execution Count:14
14
48 return ptr;
executed: return ptr;
Execution Count:436
436
49} -
50QNetworkConfigurationManager::QNetworkConfigurationManager(QObject *parent) -
51 : QObject(parent) -
52{ -
53 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
54 -
55 connect(priv, "2""configurationAdded(QNetworkConfiguration)", -
56 this, "2""configurationAdded(QNetworkConfiguration)"); -
57 connect(priv, "2""configurationRemoved(QNetworkConfiguration)", -
58 this, "2""configurationRemoved(QNetworkConfiguration)"); -
59 connect(priv, "2""configurationChanged(QNetworkConfiguration)", -
60 this, "2""configurationChanged(QNetworkConfiguration)"); -
61 connect(priv, "2""onlineStateChanged(bool)", -
62 this, "2""onlineStateChanged(bool)"); -
63 connect(priv, "2""configurationUpdateComplete()", -
64 this, "2""updateCompleted()"); -
65 -
66 priv->enablePolling(); -
67}
executed: }
Execution Count:107
107
68 -
69 -
70 -
71 -
72QNetworkConfigurationManager::~QNetworkConfigurationManager() -
73{ -
74 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
75 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:107
no
Evaluation Count:0
0-107
76 priv->disablePolling();
executed: priv->disablePolling();
Execution Count:107
107
77}
executed: }
Execution Count:107
107
78QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const -
79{ -
80 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
81 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
82 return priv->defaultConfiguration();
executed: return priv->defaultConfiguration();
Execution Count:13
13
83 -
84 return QNetworkConfiguration();
never executed: return QNetworkConfiguration();
0
85} -
86QList<QNetworkConfiguration> QNetworkConfigurationManager::allConfigurations(QNetworkConfiguration::StateFlags filter) const -
87{ -
88 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
89 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-27
90 return priv->allConfigurations(filter);
executed: return priv->allConfigurations(filter);
Execution Count:27
27
91 -
92 return QList<QNetworkConfiguration>();
never executed: return QList<QNetworkConfiguration>();
0
93} -
94 -
95 -
96 -
97 -
98 -
99 -
100 -
101QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(const QString &identifier) const -
102{ -
103 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
104 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:5
no
Evaluation Count:0
0-5
105 return priv->configurationFromIdentifier(identifier);
executed: return priv->configurationFromIdentifier(identifier);
Execution Count:5
5
106 -
107 return QNetworkConfiguration();
never executed: return QNetworkConfiguration();
0
108} -
109bool QNetworkConfigurationManager::isOnline() const -
110{ -
111 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
112 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
113 return priv->isOnline();
executed: return priv->isOnline();
Execution Count:1
1
114 -
115 return false;
never executed: return false;
0
116} -
117 -
118 -
119 -
120 -
121QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabilities() const -
122{ -
123 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
124 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:84
no
Evaluation Count:0
0-84
125 return priv->capabilities();
executed: return priv->capabilities();
Execution Count:84
84
126 -
127 return QNetworkConfigurationManager::Capabilities(0);
never executed: return QNetworkConfigurationManager::Capabilities(0);
0
128} -
129void QNetworkConfigurationManager::updateConfigurations() -
130{ -
131 QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); -
132 if (priv)
partially evaluated: priv
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
133 priv->performAsyncConfigurationUpdate();
executed: priv->performAsyncConfigurationUpdate();
Execution Count:16
16
134}
executed: }
Execution Count:16
16
135 -
136 -
137 -
138 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial