qdbusinternalfilters.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusinternalfilters.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12extern QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,-
13 const QMetaObject *base, int flags);-
14-
15static const char introspectableInterfaceXml[] =-
16 " <interface name=\"org.freedesktop.DBus.Introspectable\">\n"-
17 " <method name=\"Introspect\">\n"-
18 " <arg name=\"xml_data\" type=\"s\" direction=\"out\"/>\n"-
19 " </method>\n"-
20 " </interface>\n";-
21-
22static const char propertiesInterfaceXml[] =-
23 " <interface name=\"org.freedesktop.DBus.Properties\">\n"-
24 " <method name=\"Get\">\n"-
25 " <arg name=\"interface_name\" type=\"s\" direction=\"in\"/>\n"-
26 " <arg name=\"property_name\" type=\"s\" direction=\"in\"/>\n"-
27 " <arg name=\"value\" type=\"v\" direction=\"out\"/>\n"-
28 " </method>\n"-
29 " <method name=\"Set\">\n"-
30 " <arg name=\"interface_name\" type=\"s\" direction=\"in\"/>\n"-
31 " <arg name=\"property_name\" type=\"s\" direction=\"in\"/>\n"-
32 " <arg name=\"value\" type=\"v\" direction=\"in\"/>\n"-
33 " </method>\n"-
34 " <method name=\"GetAll\">\n"-
35 " <arg name=\"interface_name\" type=\"s\" direction=\"in\"/>\n"-
36 " <arg name=\"values\" type=\"a{sv}\" direction=\"out\"/>\n"-
37 " <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>\n"-
38 " </method>\n"-
39 " <signal name=\"PropertiesChanged\">\n"-
40 " <arg name=\"interface_name\" type=\"s\" direction=\"out\"/>\n"-
41 " <arg name=\"changed_properties\" type=\"a{sv}\" direction=\"out\"/>\n"-
42 " <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out1\" value=\"QVariantMap\"/>\n"-
43 " <arg name=\"invalidated_properties\" type=\"as\" direction=\"out\"/>\n"-
44 " </signal>\n"-
45 " </interface>\n";-
46-
47static const char peerInterfaceXml[] =-
48 " <interface name=\"org.freedesktop.DBus.Peer\">\n"-
49 " <method name=\"Ping\"/>\n"-
50 " <method name=\"GetMachineId\">\n"-
51 " <arg name=\"machine_uuid\" type=\"s\" direction=\"out\"/>\n"-
52 " </method>\n"-
53 " </interface>\n";-
54-
55static QString generateSubObjectXml(QObject *object)-
56{-
57 QString retval;-
58 const QObjectList &objs = object->children();-
59 QObjectList::ConstIterator it = objs.constBegin();-
60 QObjectList::ConstIterator end = objs.constEnd();-
61 for ( ; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
62 QString name = (*it)->objectName();-
63 if (!name.isEmpty()
!name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& QDBusUtil::isValidPartOfObjectPath(name)
QDBusUtil::isV...jectPath(name)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
64 retval += QString::fromLatin1(" <node name=\"%1\"/>\n")
never executed: retval += QString::fromLatin1(" <node name=\"%1\"/>\n") .arg(name);
0
65 .arg(name);
never executed: retval += QString::fromLatin1(" <node name=\"%1\"/>\n") .arg(name);
0
66 }
never executed: end of block
0
67 return
never executed: return retval;
retval;
never executed: return retval;
0
68}-
69-
70-
71-
72QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node, const QString &path)-
73{-
74-
75-
76 QString xml_data(QLatin1String("<!DOCTYPE node PUBLIC \"" "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "\"\n\"" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" "\">\n"));-
77 xml_data += QLatin1String("<node>\n");-
78-
79 if (node.obj
node.objDescription
TRUEevaluated 85 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
1-85
80 ((!(QThread::currentThread() == node.obj->thread())) ? qt_assert_x("QDBusConnection: internal threading error", "function called for an object that is in another thread!!",-
81-
82 __FILE__-
83 ,-
84-
85 137-
86 ) : qt_noop())-
87-
88 ;-
89-
90 if (node.flags & (QDBusConnection::ExportScriptableContents
node.flags & (...tableContents)Description
TRUEevaluated 12 times by 7 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 73 times by 5 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
12-73
91 | QDBusConnection::ExportNonScriptableContents)
node.flags & (...tableContents)Description
TRUEevaluated 12 times by 7 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 73 times by 5 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
) {
12-73
92-
93 const QMetaObject *mo = node.obj->metaObject();-
94 for ( ; mo != &QObject::staticMetaObject
mo != &QObject...aticMetaObjectDescription
TRUEevaluated 12 times by 7 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 12 times by 7 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
; mo = mo->superClass())
12
95 xml_data += qDBusGenerateMetaObjectXml(node.interfaceName, mo, mo->superClass(),
executed 12 times by 7 tests: xml_data += qDBusGenerateMetaObjectXml(node.interfaceName, mo, mo->superClass(), node.flags);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
12
96 node.flags);
executed 12 times by 7 tests: xml_data += qDBusGenerateMetaObjectXml(node.interfaceName, mo, mo->superClass(), node.flags);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
12
97 }
executed 12 times by 7 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
12
98-
99-
100 QDBusAdaptorConnector *connector;-
101 if (node.flags & QDBusConnection::ExportAdaptors
node.flags & Q...ExportAdaptorsDescription
TRUEevaluated 75 times by 6 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 10 times by 7 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusthreading - unknown status
&&
10-75
102 (
(connector = q...tor(node.obj))Description
TRUEevaluated 75 times by 6 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEnever evaluated
connector = qDBusFindAdaptorConnector(node.obj))
(connector = q...tor(node.obj))Description
TRUEevaluated 75 times by 6 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEnever evaluated
) {
0-75
103-
104-
105 QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin();-
106 QDBusAdaptorConnector::AdaptorMap::ConstIterator end = connector->adaptors.constEnd();-
107 for ( ; it != end
it != endDescription
TRUEevaluated 129 times by 5 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 75 times by 6 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
; ++it) {
75-129
108-
109 QString ifaceXml = QDBusAbstractAdaptorPrivate::retrieveIntrospectionXml(it->adaptor);-
110 if (ifaceXml.isEmpty()
ifaceXml.isEmpty()Description
TRUEevaluated 89 times by 5 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
FALSEevaluated 40 times by 2 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusthreading - unknown status
) {
40-89
111-
112 ifaceXml += qDBusGenerateMetaObjectXml(QString::fromLatin1(it->interface),-
113 it->adaptor->metaObject(),-
114 &QDBusAbstractAdaptor::staticMetaObject,-
115 QDBusConnection::ExportScriptableContents-
116 | QDBusConnection::ExportNonScriptableContents);-
117-
118 QDBusAbstractAdaptorPrivate::saveIntrospectionXml(it->adaptor, ifaceXml);-
119 }
executed 89 times by 5 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
89
120-
121 xml_data += ifaceXml;-
122 }
executed 129 times by 5 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
129
123 }
executed 75 times by 6 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
75
124-
125-
126 if (node.flags & QDBusConnectionPrivate::VirtualObject
node.flags & Q...:VirtualObjectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusinterface - unknown status
FALSEevaluated 83 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
) {
2-83
127 xml_data += node.treeNode->introspect(path);-
128 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qdbusinterface - unknown status
2
129-
130 xml_data += QLatin1String( propertiesInterfaceXml );-
131 }
executed 85 times by 11 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
85
132-
133 xml_data += QLatin1String( introspectableInterfaceXml );-
134 xml_data += QLatin1String( peerInterfaceXml );-
135-
136 if (node.flags & QDBusConnection::ExportChildObjects
node.flags & Q...rtChildObjectsDescription
TRUEnever evaluated
FALSEevaluated 86 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
) {
0-86
137 xml_data += generateSubObjectXml(node.obj);-
138 }
never executed: end of block
else {
0
139-
140 QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator it =-
141 node.children.constBegin();-
142 QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator end =-
143 node.children.constEnd();-
144 for ( ; it != end
it != endDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 86 times by 11 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
; ++it)
28-86
145 if (it->obj
it->objDescription
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
|| !it->children.isEmpty()
!it->children.isEmpty()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
)
0-28
146 xml_data += QString::fromLatin1(" <node name=\"%1\"/>\n")
executed 28 times by 1 test: xml_data += QString::fromLatin1(" <node name=\"%1\"/>\n") .arg(it->name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
28
147 .arg(it->name);
executed 28 times by 1 test: xml_data += QString::fromLatin1(" <node name=\"%1\"/>\n") .arg(it->name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
28
148 }
executed 86 times by 11 tests: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
86
149-
150 xml_data += QLatin1String("</node>\n");-
151 return
executed 86 times by 11 tests: return xml_data;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
xml_data;
executed 86 times by 11 tests: return xml_data;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusconnection - unknown status
  • tst_qdbusconnection_no_app - unknown status
  • tst_qdbusconnection_spyhook - unknown status
  • tst_qdbuscontext - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbuspendingcall - unknown status
  • tst_qdbuspendingreply - unknown status
  • tst_qdbusreply - unknown status
  • tst_qdbusthreading - unknown status
86
152}-
153-
154-
155-
156static inline QDBusMessage interfaceNotFoundError(const QDBusMessage &msg, const QString &interface_name)-
157{-
158 return
executed 8 times by 1 test: return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
msg.createErrorReply(QDBusError::UnknownInterface,
executed 8 times by 1 test: return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
159 QString::fromLatin1("Interface %1 was not found in object %2")
executed 8 times by 1 test: return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
160 .arg(interface_name)
executed 8 times by 1 test: return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
161 .arg(msg.path()));
executed 8 times by 1 test: return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
162}-
163-
164static inline QDBusMessage-
165propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, const QByteArray &property_name)-
166{-
167 return
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
msg.createErrorReply(QDBusError::UnknownProperty,
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
168 QString::fromLatin1("Property %1%2%3 was not found in object %4")
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
169 .arg(interface_name,
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
170 QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
171 QString::fromLatin1(property_name),
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
172 msg.path()));
never executed: return msg.createErrorReply(QDBusError::UnknownProperty, QString::fromLatin1("Property %1%2%3 was not found in object %4") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name), msg.path()));
0
173}-
174-
175QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node,-
176 const QDBusMessage &msg)-
177{-
178 ((!(msg.arguments().count() == 2)) ? qt_assert("msg.arguments().count() == 2",__FILE__,227) : qt_noop());-
179 ((!(!node.obj || QThread::currentThread() == node.obj->thread())) ? qt_assert_x("QDBusConnection: internal threading error", "function called for an object that is in another thread!!",-
180-
181 __FILE__-
182 ,-
183-
184 230-
185 ) : qt_noop())-
186-
187 ;-
188-
189 QString interface_name = msg.arguments().at(0).toString();-
190 QByteArray property_name = msg.arguments().at(1).toString().toUtf8();-
191-
192 QDBusAdaptorConnector *connector;-
193 QVariant value;-
194 bool interfaceFound = false;-
195 if (node.flags & QDBusConnection::ExportAdaptors
node.flags & Q...ExportAdaptorsDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
&&
16-26
196 (
(connector = q...tor(node.obj))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
connector = qDBusFindAdaptorConnector(node.obj))
(connector = q...tor(node.obj))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
) {
0-26
197-
198-
199-
200 if (interface_name.isEmpty()
interface_name.isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
12-14
201 for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(),-
202 end = connector->adaptors.constEnd(); it != end
it != endDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
; ++it) {
4-38
203 const QMetaObject *mo = it->adaptor->metaObject();-
204 int pidx = mo->indexOfProperty(property_name);-
205 if (pidx != -1
pidx != -1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
8-30
206 value = mo->property(pidx).read(it->adaptor);-
207 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
208 }-
209 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
30
210 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
else {
12
211 QDBusAdaptorConnector::AdaptorMap::ConstIterator it;-
212 it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),-
213 interface_name);-
214 if (it != connector->adaptors.constEnd()
it != connecto...ors.constEnd()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
&& interface_name == QLatin1String(it->interface)
interface_name...it->interface)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
0-14
215 interfaceFound = true;-
216 value = it->adaptor->property(property_name);-
217 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
12
218 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
14
219 }-
220-
221 if (!interfaceFound
!interfaceFoundDescription
TRUEevaluated 30 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
&& !value.isValid()
!value.isValid()Description
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
8-30
222 && node.flags & (QDBusConnection::ExportAllProperties |
node.flags & (...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
6-16
223 QDBusConnection::ExportNonScriptableProperties)
node.flags & (...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
6-16
224-
225 if (!interface_name.isEmpty()
!interface_name.isEmpty()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
)
0-16
226 interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);
executed 16 times by 2 tests: interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
227-
228 if (interfaceFound
interfaceFoundDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
229 int pidx = node.obj->metaObject()->indexOfProperty(property_name);-
230 if (pidx != -1
pidx != -1Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
231 QMetaProperty mp = node.obj->metaObject()->property(pidx);-
232 if ((mp.isScriptable()
mp.isScriptable()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
&& (
(node.flags & ...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
node.flags & QDBusConnection::ExportScriptableProperties)
(node.flags & ...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) ||
0-16
233 (!mp.isScriptable()
!mp.isScriptable()Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(node.flags & ...bleProperties)Description
TRUEnever evaluated
FALSEnever evaluated
node.flags & QDBusConnection::ExportNonScriptableProperties)
(node.flags & ...bleProperties)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
234 value = mp.read(node.obj);
executed 16 times by 2 tests: value = mp.read(node.obj);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
235 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
236 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
237 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
238-
239 if (!value.isValid()
!value.isValid()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 36 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
) {
6-36
240-
241 if (!interfaceFound
!interfaceFoundDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
)
0-6
242 return
executed 6 times by 1 test: return interfaceNotFoundError(msg, interface_name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
interfaceNotFoundError(msg, interface_name);
executed 6 times by 1 test: return interfaceNotFoundError(msg, interface_name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
243 return
never executed: return propertyNotFoundError(msg, interface_name, property_name);
propertyNotFoundError(msg, interface_name, property_name);
never executed: return propertyNotFoundError(msg, interface_name, property_name);
0
244 }-
245-
246 return
executed 36 times by 3 tests: return msg.createReply(QVariant::fromValue(QDBusVariant(value)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
msg.createReply(QVariant::fromValue(QDBusVariant(value)));
executed 36 times by 3 tests: return msg.createReply(QVariant::fromValue(QDBusVariant(value)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
36
247}-
248-
249enum PropertyWriteResult {-
250 PropertyWriteSuccess = 0,-
251 PropertyNotFound,-
252 PropertyTypeMismatch,-
253 PropertyReadOnly,-
254 PropertyWriteFailed-
255};-
256-
257static QDBusMessage propertyWriteReply(const QDBusMessage &msg, const QString &interface_name,-
258 const QByteArray &property_name, int status)-
259{-
260 switch (status) {-
261 case
never executed: case PropertyNotFound:
PropertyNotFound:
never executed: case PropertyNotFound:
0
262 return
never executed: return propertyNotFoundError(msg, interface_name, property_name);
propertyNotFoundError(msg, interface_name, property_name);
never executed: return propertyNotFoundError(msg, interface_name, property_name);
0
263 case
never executed: case PropertyTypeMismatch:
PropertyTypeMismatch:
never executed: case PropertyTypeMismatch:
0
264 return
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
msg.createErrorReply(QDBusError::InvalidArgs,
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
0
265 QString::fromLatin1("Invalid arguments for writing to property %1%2%3")
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
0
266 .arg(interface_name,
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
0
267 QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
0
268 QString::fromLatin1(property_name)));
never executed: return msg.createErrorReply(QDBusError::InvalidArgs, QString::fromLatin1("Invalid arguments for writing to property %1%2%3") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
0
269 case
executed 6 times by 1 test: case PropertyReadOnly:
Executed by:
  • tst_qdbusabstractadaptor - unknown status
PropertyReadOnly:
executed 6 times by 1 test: case PropertyReadOnly:
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
270 return
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
msg.createErrorReply(QDBusError::PropertyReadOnly,
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
271 QString::fromLatin1("Property %1%2%3 is read-only")
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
272 .arg(interface_name,
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
273 QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
274 QString::fromLatin1(property_name)));
executed 6 times by 1 test: return msg.createErrorReply(QDBusError::PropertyReadOnly, QString::fromLatin1("Property %1%2%3 is read-only") .arg(interface_name, QString::fromLatin1(interface_name.isEmpty() ? "" : "."), QString::fromLatin1(property_name)));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
275 case
never executed: case PropertyWriteFailed:
PropertyWriteFailed:
never executed: case PropertyWriteFailed:
0
276 return
never executed: return msg.createErrorReply(QDBusError::InternalError, QString::fromLatin1("Internal error"));
msg.createErrorReply(QDBusError::InternalError,
never executed: return msg.createErrorReply(QDBusError::InternalError, QString::fromLatin1("Internal error"));
0
277 QString::fromLatin1("Internal error"));
never executed: return msg.createErrorReply(QDBusError::InternalError, QString::fromLatin1("Internal error"));
0
278-
279 case
executed 22 times by 3 tests: case PropertyWriteSuccess:
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
PropertyWriteSuccess:
executed 22 times by 3 tests: case PropertyWriteSuccess:
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
22
280 return
executed 22 times by 3 tests: return msg.createReply();
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
msg.createReply();
executed 22 times by 3 tests: return msg.createReply();
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
22
281 }-
282 ((!(false)) ? qt_assert_x("", "Should not be reached",__FILE__,325) : qt_noop());-
283 return
never executed: return QDBusMessage();
QDBusMessage();
never executed: return QDBusMessage();
0
284}-
285-
286static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant value,-
287 int propFlags = QDBusConnection::ExportAllProperties)-
288{-
289 const QMetaObject *mo = obj->metaObject();-
290 int pidx = mo->indexOfProperty(property_name);-
291 if (pidx == -1
pidx == -1Description
TRUEnever evaluated
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
) {
0-28
292-
293 return
never executed: return PropertyNotFound;
PropertyNotFound;
never executed: return PropertyNotFound;
0
294 }-
295-
296 QMetaProperty mp = mo->property(pidx);-
297-
298-
299 if (!mp.isWritable()
!mp.isWritable()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
)
6-22
300 return
executed 6 times by 1 test: return PropertyReadOnly;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
PropertyReadOnly;
executed 6 times by 1 test: return PropertyReadOnly;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
301-
302-
303 bool isScriptable = mp.isScriptable();-
304 if (!(propFlags & QDBusConnection::ExportScriptableProperties)
!(propFlags & ...bleProperties)Description
TRUEnever evaluated
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
&& isScriptable
isScriptableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-22
305 return
never executed: return PropertyNotFound;
PropertyNotFound;
never executed: return PropertyNotFound;
0
306 if (!(propFlags & QDBusConnection::ExportNonScriptableProperties)
!(propFlags & ...bleProperties)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusinterface - unknown status
&& !isScriptable
!isScriptableDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
)
0-12
307 return
never executed: return PropertyNotFound;
PropertyNotFound;
never executed: return PropertyNotFound;
0
308-
309-
310-
311 int id = mp.userType();-
312 if (!id
!idDescription
TRUEnever evaluated
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
){
0-22
313-
314 QMessageLogger(__FILE__, 357, __PRETTY_FUNCTION__).warning("QDBusConnection: Unable to handle unregistered datatype '%s' for property '%s::%s'",-
315 mp.typeName(), mo->className(), property_name.constData());-
316 return
never executed: return PropertyWriteFailed;
PropertyWriteFailed;
never executed: return PropertyWriteFailed;
0
317 }-
318-
319 if (id != QMetaType::QVariant
id != QMetaType::QVariantDescription
TRUEevaluated 22 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
&& value.userType() == QDBusMetaTypeId::argument()
value.userType...Id::argument()Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEevaluated 16 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
) {
0-22
320-
321 void *null = 0;-
322 QVariant other(id, null);-
323 if (!QDBusMetaType::demarshall(qvariant_cast<QDBusArgument>(value), id, other.data())
!QDBusMetaType... other.data())Description
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
) {
0-6
324 QMessageLogger(__FILE__, 367, __PRETTY_FUNCTION__).warning("QDBusConnection: type `%s' (%d) is not registered with QtDBus. "-
325 "Use qDBusRegisterMetaType to register it",-
326 mp.typeName(), id);-
327 return
never executed: return PropertyWriteFailed;
PropertyWriteFailed;
never executed: return PropertyWriteFailed;
0
328 }-
329-
330 value = other;-
331 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
6
332-
333 if (mp.userType() == qMetaTypeId<QDBusVariant>()
mp.userType() ...DBusVariant>()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
)
4-18
334 value = QVariant::fromValue(QDBusVariant(value));
executed 4 times by 1 test: value = QVariant::fromValue(QDBusVariant(value));
Executed by:
  • tst_qdbusabstractinterface - unknown status
4
335-
336-
337 return
executed 22 times by 3 tests: return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;
executed 22 times by 3 tests: return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
22
338}-
339-
340QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node,-
341 const QDBusMessage &msg)-
342{-
343 ((!(msg.arguments().count() == 3)) ? qt_assert("msg.arguments().count() == 3",__FILE__,386) : qt_noop());-
344 ((!(!node.obj || QThread::currentThread() == node.obj->thread())) ? qt_assert_x("QDBusConnection: internal threading error", "function called for an object that is in another thread!!",-
345-
346 __FILE__-
347 ,-
348-
349 389-
350 ) : qt_noop())-
351-
352 ;-
353-
354 QString interface_name = msg.arguments().at(0).toString();-
355 QByteArray property_name = msg.arguments().at(1).toString().toUtf8();-
356 QVariant value = qvariant_cast<QDBusVariant>(msg.arguments().at(2)).variant();-
357-
358 QDBusAdaptorConnector *connector;-
359 if (node.flags & QDBusConnection::ExportAdaptors
node.flags & Q...ExportAdaptorsDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
&&
12-16
360 (
(connector = q...tor(node.obj))Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
connector = qDBusFindAdaptorConnector(node.obj))
(connector = q...tor(node.obj))Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
) {
0-12
361-
362-
363-
364 if (interface_name.isEmpty()
interface_name.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
0-12
365 for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(),-
366 end = connector->adaptors.constEnd(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
367 int status = writeProperty(it->adaptor, property_name, value);-
368 if (status == PropertyNotFound
status == PropertyNotFoundDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
369 continue;
never executed: continue;
0
370 return
never executed: return propertyWriteReply(msg, interface_name, property_name, status);
propertyWriteReply(msg, interface_name, property_name, status);
never executed: return propertyWriteReply(msg, interface_name, property_name, status);
0
371 }-
372 }
never executed: end of block
else {
0
373 QDBusAdaptorConnector::AdaptorMap::ConstIterator it;-
374 it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),-
375 interface_name);-
376 if (it != connector->adaptors.end()
it != connecto...adaptors.end()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
&& interface_name == QLatin1String(it->interface)
interface_name...it->interface)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
) {
0-12
377 return
executed 12 times by 1 test: return propertyWriteReply(msg, interface_name, property_name, writeProperty(it->adaptor, property_name, value));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
propertyWriteReply(msg, interface_name, property_name,
executed 12 times by 1 test: return propertyWriteReply(msg, interface_name, property_name, writeProperty(it->adaptor, property_name, value));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
12
378 writeProperty(it->adaptor, property_name, value));
executed 12 times by 1 test: return propertyWriteReply(msg, interface_name, property_name, writeProperty(it->adaptor, property_name, value));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
12
379 }-
380 }
never executed: end of block
0
381 }-
382-
383 if (node.flags & (QDBusConnection::ExportScriptableProperties |
node.flags & (...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
0-16
384 QDBusConnection::ExportNonScriptableProperties)
node.flags & (...bleProperties)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
385-
386 bool interfaceFound = true;-
387 if (!interface_name.isEmpty()
!interface_name.isEmpty()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
)
0-16
388 interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);
executed 16 times by 2 tests: interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
389-
390 if (interfaceFound
interfaceFoundDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
FALSEnever evaluated
) {
0-16
391 return
executed 16 times by 2 tests: return propertyWriteReply(msg, interface_name, property_name, writeProperty(node.obj, property_name, value, node.flags));
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
propertyWriteReply(msg, interface_name, property_name,
executed 16 times by 2 tests: return propertyWriteReply(msg, interface_name, property_name, writeProperty(node.obj, property_name, value, node.flags));
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
392 writeProperty(node.obj, property_name, value, node.flags));
executed 16 times by 2 tests: return propertyWriteReply(msg, interface_name, property_name, writeProperty(node.obj, property_name, value, node.flags));
Executed by:
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
16
393 }-
394 }
never executed: end of block
0
395-
396-
397 if (!interface_name.isEmpty()
!interface_name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
398 return
never executed: return interfaceNotFoundError(msg, interface_name);
interfaceNotFoundError(msg, interface_name);
never executed: return interfaceNotFoundError(msg, interface_name);
0
399 return
never executed: return propertyWriteReply(msg, interface_name, property_name, PropertyNotFound);
propertyWriteReply(msg, interface_name, property_name, PropertyNotFound);
never executed: return propertyWriteReply(msg, interface_name, property_name, PropertyNotFound);
0
400}-
401-
402-
403static QVariantMap &operator+=(QVariantMap &lhs, const QVariantMap &rhs)-
404{-
405 QVariantMap::ConstIterator it = rhs.constBegin(),-
406 end = rhs.constEnd();-
407 for ( ; it != end
it != endDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
; ++it)
16-32
408 lhs.insert(it.key(), it.value());
executed 32 times by 1 test: lhs.insert(it.key(), it.value());
Executed by:
  • tst_qdbusabstractadaptor - unknown status
32
409 return
executed 16 times by 1 test: return lhs;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
lhs;
executed 16 times by 1 test: return lhs;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
16
410}-
411-
412static QVariantMap readAllProperties(QObject *object, int flags)-
413{-
414 QVariantMap result;-
415 const QMetaObject *mo = object->metaObject();-
416-
417-
418 for (int i = QObject::staticMetaObject.propertyCount(); i < mo->propertyCount()
i < mo->propertyCount()Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
; ++i) {
22-54
419 QMetaProperty mp = mo->property(i);-
420-
421-
422 if (!mp.isReadable()
!mp.isReadable()Description
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
)
0-54
423 continue;
never executed: continue;
0
424-
425-
426 int typeId = mp.userType();-
427 if (!typeId
!typeIdDescription
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
)
0-54
428 continue;
never executed: continue;
0
429 const char *signature = QDBusMetaType::typeToSignature(typeId);-
430 if (!signature
!signatureDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
)
6-48
431 continue;
executed 6 times by 1 test: continue;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
432-
433-
434 if ((mp.isScriptable()
mp.isScriptable()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
&& flags & QDBusConnection::ExportScriptableProperties
flags & QDBusC...ablePropertiesDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
) ||
0-48
435 (!mp.isScriptable()
!mp.isScriptable()Description
TRUEnever evaluated
FALSEnever evaluated
&& flags & QDBusConnection::ExportNonScriptableProperties
flags & QDBusC...ablePropertiesDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
436-
437 QVariant value = mp.read(object);-
438 if (value.isValid()
value.isValid()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
)
0-48
439 result.insert(QString::fromLatin1(mp.name()), value);
executed 48 times by 1 test: result.insert(QString::fromLatin1(mp.name()), value);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
48
440 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
48
441 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
48
442-
443 return
executed 22 times by 1 test: return result;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
result;
executed 22 times by 1 test: return result;
Executed by:
  • tst_qdbusabstractadaptor - unknown status
22
444}-
445-
446QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &node,-
447 const QDBusMessage &msg)-
448{-
449 ((!(msg.arguments().count() == 1)) ? qt_assert("msg.arguments().count() == 1",__FILE__,486) : qt_noop());-
450 ((!(!node.obj || QThread::currentThread() == node.obj->thread())) ? qt_assert_x("QDBusConnection: internal threading error", "function called for an object that is in another thread!!",-
451-
452 __FILE__-
453 ,-
454-
455 489-
456 ) : qt_noop())-
457-
458 ;-
459-
460 QString interface_name = msg.arguments().at(0).toString();-
461-
462 bool interfaceFound = false;-
463 QVariantMap result;-
464-
465 QDBusAdaptorConnector *connector;-
466 if (node.flags & QDBusConnection::ExportAdaptors
node.flags & Q...ExportAdaptorsDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
&&
0-12
467 (
(connector = q...tor(node.obj))Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
connector = qDBusFindAdaptorConnector(node.obj))
(connector = q...tor(node.obj))Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
) {
0-12
468-
469 if (interface_name.isEmpty()
interface_name.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
4-8
470-
471 for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(),-
472 end = connector->adaptors.constEnd(); it != end
it != endDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
; ++it) {
4-16
473 result += readAllProperties(it->adaptor, QDBusConnection::ExportAllProperties);-
474 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
16
475 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
else {
4
476-
477 QDBusAdaptorConnector::AdaptorMap::ConstIterator it;-
478 it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),-
479 interface_name);-
480 if (it != connector->adaptors.constEnd()
it != connecto...ors.constEnd()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEnever evaluated
&& interface_name == QLatin1String(it->interface)
interface_name...it->interface)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
0-8
481 interfaceFound = true;-
482 result = readAllProperties(it->adaptor, QDBusConnection::ExportAllProperties);-
483 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
6
484 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qdbusabstractadaptor - unknown status
8
485 }-
486-
487 if (node.flags & QDBusConnection::ExportAllProperties
node.flags & Q...tAllPropertiesDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
&&
0-12
488 (!interfaceFound
!interfaceFoundDescription
TRUEnever evaluated
FALSEnever evaluated
|| interface_name.isEmpty()
interface_name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
489-
490 result += readAllProperties(node.obj, node.flags);-
491 interfaceFound = true;-
492 }
never executed: end of block
0
493-
494 if (!interfaceFound
!interfaceFoundDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
&& !interface_name.isEmpty()
!interface_name.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qdbusabstractadaptor - unknown status
) {
2-6
495-
496 return
executed 2 times by 1 test: return interfaceNotFoundError(msg, interface_name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
interfaceNotFoundError(msg, interface_name);
executed 2 times by 1 test: return interfaceNotFoundError(msg, interface_name);
Executed by:
  • tst_qdbusabstractadaptor - unknown status
2
497 }-
498-
499 return
executed 10 times by 1 test: return msg.createReply(QVariant::fromValue(result));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
msg.createReply(QVariant::fromValue(result));
executed 10 times by 1 test: return msg.createReply(QVariant::fromValue(result));
Executed by:
  • tst_qdbusabstractadaptor - unknown status
10
500}-
501-
502-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9