Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | static QFactoryLoader *bridgeloader() { static QGlobalStatic<QFactoryLoader > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QFactoryLoader *x = new QFactoryLoader ("org.qt-project.Qt.QAccessibleBridgeFactoryInterface", QLatin1String("/accessiblebridge")); 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:5 partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:5 |
partially evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
10 | | - |
11 | | - |
12 | | - |
13 | static QVector<QAccessibleBridge *> *bridges() { static QGlobalStatic<QVector<QAccessibleBridge *> > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { QVector<QAccessibleBridge *> *x = new QVector<QAccessibleBridge *>; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<QVector<QAccessibleBridge *> > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } never executed: delete x; partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:5 |
executed: return thisGlobalStatic.pointer.load(); Execution Count:43 evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:5 | yes Evaluation Count:38 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-43 |
14 | QPlatformAccessibility::QPlatformAccessibility() | - |
15 | { | - |
16 | } | - |
17 | | - |
18 | QPlatformAccessibility::~QPlatformAccessibility() | - |
19 | { | - |
20 | } | - |
21 | | - |
22 | void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) | - |
23 | { | - |
24 | initialize(); | - |
25 | | - |
26 | if (!bridges() || bridges()->isEmpty()) never evaluated: !bridges() never evaluated: bridges()->isEmpty() | 0 |
27 | return; | 0 |
28 | | - |
29 | for (int i = 0; i < bridges()->count(); ++i) never evaluated: i < bridges()->count() | 0 |
30 | bridges()->at(i)->notifyAccessibilityUpdate(event); never executed: bridges()->at(i)->notifyAccessibilityUpdate(event); | 0 |
31 | } | 0 |
32 | | - |
33 | void QPlatformAccessibility::setRootObject(QObject *o) | - |
34 | { | - |
35 | initialize(); | - |
36 | if (bridges()->isEmpty()) partially evaluated: bridges()->isEmpty() yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
37 | return; executed: return; Execution Count:43 | 43 |
38 | | - |
39 | if (!o) | 0 |
40 | return; | 0 |
41 | | - |
42 | for (int i = 0; i < bridges()->count(); ++i) { never evaluated: i < bridges()->count() | 0 |
43 | QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o); | - |
44 | bridges()->at(i)->setRootObject(iface); | - |
45 | } | 0 |
46 | } | 0 |
47 | | - |
48 | void QPlatformAccessibility::initialize() | - |
49 | { | - |
50 | static bool isInit = false; | - |
51 | if (isInit) evaluated: isInit yes Evaluation Count:38 | yes Evaluation Count:5 |
| 5-38 |
52 | return; executed: return; Execution Count:38 | 38 |
53 | isInit = true; | - |
54 | | - |
55 | | - |
56 | typedef QMultiMap<int, QString> PluginKeyMap; | - |
57 | typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator; | - |
58 | | - |
59 | const PluginKeyMap keyMap = bridgeloader()->keyMap(); | - |
60 | QAccessibleBridgePlugin *factory = 0; | - |
61 | int i = -1; | - |
62 | const PluginKeyMapConstIterator cend = keyMap.constEnd(); | - |
63 | for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) { partially evaluated: it != cend no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
64 | if (it.key() != i) { never evaluated: it.key() != i | 0 |
65 | i = it.key(); | - |
66 | factory = qobject_cast<QAccessibleBridgePlugin*>(bridgeloader()->instance(i)); | - |
67 | } | 0 |
68 | if (factory) | 0 |
69 | if (QAccessibleBridge *bridge = factory->create(it.value())) never evaluated: QAccessibleBridge *bridge = factory->create(it.value()) | 0 |
70 | bridges()->append(bridge); never executed: bridges()->append(bridge); | 0 |
71 | } | 0 |
72 | | - |
73 | } executed: } Execution Count:5 | 5 |
74 | | - |
75 | void QPlatformAccessibility::cleanup() | - |
76 | { | - |
77 | qDeleteAll(*bridges()); | - |
78 | } | 0 |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
| | |