Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | QTouchDevice::QTouchDevice() | - |
4 | : d(new QTouchDevicePrivate) | - |
5 | { | - |
6 | } executed: } Execution Count:15 | 15 |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | QTouchDevice::~QTouchDevice() | - |
12 | { | - |
13 | delete d; | - |
14 | } executed: } Execution Count:15 | 15 |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | QTouchDevice::DeviceType QTouchDevice::type() const | - |
20 | { | - |
21 | return d->type; executed: return d->type; Execution Count:85 | 85 |
22 | } | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | QTouchDevice::Capabilities QTouchDevice::capabilities() const | - |
28 | { | - |
29 | return d->caps; never executed: return d->caps; | 0 |
30 | } | - |
31 | QString QTouchDevice::name() const | - |
32 | { | - |
33 | return d->name; never executed: return d->name; | 0 |
34 | } | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | void QTouchDevice::setType(DeviceType devType) | - |
40 | { | - |
41 | d->type = devType; | - |
42 | } executed: } Execution Count:14 | 14 |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | void QTouchDevice::setCapabilities(Capabilities caps) | - |
48 | { | - |
49 | d->caps = caps; | - |
50 | } | 0 |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | void QTouchDevice::setName(const QString &name) | - |
59 | { | - |
60 | d->name = name; | - |
61 | } | 0 |
62 | | - |
63 | typedef QList<QTouchDevice *> TouchDevices; | - |
64 | static TouchDevices *deviceList() { static QGlobalStatic<TouchDevices > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { TouchDevices *x = new TouchDevices; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<TouchDevices > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:6 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:6 | yes Evaluation Count:84 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:6 | no Evaluation Count:0 |
never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:90 | 0-90 |
65 | static QBasicMutex devicesMutex; | - |
66 | | - |
67 | static void cleanupDevicesList() | - |
68 | { | - |
69 | QMutexLocker lock(&devicesMutex); | - |
70 | qDeleteAll(*deviceList()); | - |
71 | deviceList()->clear(); | - |
72 | } executed: } Execution Count:5 | 5 |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | QList<const QTouchDevice *> QTouchDevice::devices() | - |
80 | { | - |
81 | QMutexLocker lock(&devicesMutex); | - |
82 | QList<QTouchDevice *> *devList = deviceList(); | - |
83 | QList<const QTouchDevice *> constDevList; | - |
84 | for (int i = 0, count = devList->count(); i != count; ++i) partially evaluated: i != count no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
85 | constDevList.append(devList->at(i)); never executed: constDevList.append(devList->at(i)); | 0 |
86 | return constDevList; executed: return constDevList; Execution Count:1 | 1 |
87 | } | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | bool QTouchDevicePrivate::isRegistered(QTouchDevice *dev) | - |
93 | { | - |
94 | QMutexLocker lock(&devicesMutex); | - |
95 | return deviceList()->contains(dev); executed: return deviceList()->contains(dev); Execution Count:49 | 49 |
96 | } | - |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | void QTouchDevicePrivate::registerDevice(QTouchDevice *dev) | - |
102 | { | - |
103 | QMutexLocker lock(&devicesMutex); | - |
104 | if (deviceList()->isEmpty()) evaluated: deviceList()->isEmpty() yes Evaluation Count:5 | yes Evaluation Count:10 |
| 5-10 |
105 | qAddPostRoutine(cleanupDevicesList); executed: qAddPostRoutine(cleanupDevicesList); Execution Count:5 | 5 |
106 | deviceList()->append(dev); | - |
107 | } executed: } Execution Count:15 | 15 |
108 | | - |
109 | | - |
110 | | - |
| | |