kernel/qtouchdevice.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3QTouchDevice::QTouchDevice() -
4 : d(new QTouchDevicePrivate) -
5{ -
6}
executed: }
Execution Count:15
15
7 -
8 -
9 -
10 -
11QTouchDevice::~QTouchDevice() -
12{ -
13 delete d; -
14}
executed: }
Execution Count:15
15
15 -
16 -
17 -
18 -
19QTouchDevice::DeviceType QTouchDevice::type() const -
20{ -
21 return d->type;
executed: return d->type;
Execution Count:85
85
22} -
23 -
24 -
25 -
26 -
27QTouchDevice::Capabilities QTouchDevice::capabilities() const -
28{ -
29 return d->caps;
never executed: return d->caps;
0
30} -
31QString QTouchDevice::name() const -
32{ -
33 return d->name;
never executed: return d->name;
0
34} -
35 -
36 -
37 -
38 -
39void QTouchDevice::setType(DeviceType devType) -
40{ -
41 d->type = devType; -
42}
executed: }
Execution Count:14
14
43 -
44 -
45 -
46 -
47void QTouchDevice::setCapabilities(Capabilities caps) -
48{ -
49 d->caps = caps; -
50}
never executed: }
0
51 -
52 -
53 -
54 -
55 -
56 -
57 -
58void QTouchDevice::setName(const QString &name) -
59{ -
60 d->name = name; -
61}
never executed: }
0
62 -
63typedef QList<QTouchDevice *> TouchDevices; -
64static 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)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:84
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:90
0-90
65static QBasicMutex devicesMutex; -
66 -
67static 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 -
79QList<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
TRUEFALSE
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 -
92bool 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 -
101void QTouchDevicePrivate::registerDevice(QTouchDevice *dev) -
102{ -
103 QMutexLocker lock(&devicesMutex); -
104 if (deviceList()->isEmpty())
evaluated: deviceList()->isEmpty()
TRUEFALSE
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 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial