| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusinternalfilters.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | - | |||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | extern QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, | - | ||||||||||||||||||
| 13 | const QMetaObject *base, int flags); | - | ||||||||||||||||||
| 14 | - | |||||||||||||||||||
| 15 | static 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 | - | |||||||||||||||||||
| 22 | static 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 | - | |||||||||||||||||||
| 47 | static 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 | - | |||||||||||||||||||
| 55 | static 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
| 0 | ||||||||||||||||||
| 62 | QString name = (*it)->objectName(); | - | ||||||||||||||||||
| 63 | if (!name.isEmpty()
| 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: retval;return retval;never executed: return retval; | 0 | ||||||||||||||||||
| 68 | } | - | ||||||||||||||||||
| 69 | - | |||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | - | |||||||||||||||||||
| 72 | QString 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
| 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
| 12-73 | ||||||||||||||||||
| 91 | | QDBusConnection::ExportNonScriptableContents)
| 12-73 | ||||||||||||||||||
| 92 | - | |||||||||||||||||||
| 93 | const QMetaObject *mo = node.obj->metaObject(); | - | ||||||||||||||||||
| 94 | for ( ; mo != &QObject::staticMetaObject
| 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:
| 12 | ||||||||||||||||||
| 96 | node.flags); executed 12 times by 7 tests: xml_data += qDBusGenerateMetaObjectXml(node.interfaceName, mo, mo->superClass(), node.flags);Executed by:
| 12 | ||||||||||||||||||
| 97 | } executed 12 times by 7 tests: end of blockExecuted by:
| 12 | ||||||||||||||||||
| 98 | - | |||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | QDBusAdaptorConnector *connector; | - | ||||||||||||||||||
| 101 | if (node.flags & QDBusConnection::ExportAdaptors
| 10-75 | ||||||||||||||||||
| 102 | (
| 0-75 | ||||||||||||||||||
| 103 | - | |||||||||||||||||||
| 104 | - | |||||||||||||||||||
| 105 | QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(); | - | ||||||||||||||||||
| 106 | QDBusAdaptorConnector::AdaptorMap::ConstIterator end = connector->adaptors.constEnd(); | - | ||||||||||||||||||
| 107 | for ( ; it != end
| 75-129 | ||||||||||||||||||
| 108 | - | |||||||||||||||||||
| 109 | QString ifaceXml = QDBusAbstractAdaptorPrivate::retrieveIntrospectionXml(it->adaptor); | - | ||||||||||||||||||
| 110 | if (ifaceXml.isEmpty()
| 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 blockExecuted by:
| 89 | ||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | xml_data += ifaceXml; | - | ||||||||||||||||||
| 122 | } executed 129 times by 5 tests: end of blockExecuted by:
| 129 | ||||||||||||||||||
| 123 | } executed 75 times by 6 tests: end of blockExecuted by:
| 75 | ||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | - | |||||||||||||||||||
| 126 | if (node.flags & QDBusConnectionPrivate::VirtualObject
| 2-83 | ||||||||||||||||||
| 127 | xml_data += node.treeNode->introspect(path); | - | ||||||||||||||||||
| 128 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | xml_data += QLatin1String( propertiesInterfaceXml ); | - | ||||||||||||||||||
| 131 | } executed 85 times by 11 tests: end of blockExecuted by:
| 85 | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | xml_data += QLatin1String( introspectableInterfaceXml ); | - | ||||||||||||||||||
| 134 | xml_data += QLatin1String( peerInterfaceXml ); | - | ||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | if (node.flags & QDBusConnection::ExportChildObjects
| 0-86 | ||||||||||||||||||
| 137 | xml_data += generateSubObjectXml(node.obj); | - | ||||||||||||||||||
| 138 | } never executed: else {end of block | 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
| 28-86 | ||||||||||||||||||
| 145 | if (it->obj
| 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:
| 28 | ||||||||||||||||||
| 147 | .arg(it->name); executed 28 times by 1 test: xml_data += QString::fromLatin1(" <node name=\"%1\"/>\n") .arg(it->name);Executed by:
| 28 | ||||||||||||||||||
| 148 | } executed 86 times by 11 tests: end of blockExecuted by:
| 86 | ||||||||||||||||||
| 149 | - | |||||||||||||||||||
| 150 | xml_data += QLatin1String("</node>\n"); | - | ||||||||||||||||||
| 151 | return executed 86 times by 11 tests: xml_data;return xml_data;Executed by:
executed 86 times by 11 tests: return xml_data;Executed by:
| 86 | ||||||||||||||||||
| 152 | } | - | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | - | |||||||||||||||||||
| 155 | - | |||||||||||||||||||
| 156 | static inline QDBusMessage interfaceNotFoundError(const QDBusMessage &msg, const QString &interface_name) | - | ||||||||||||||||||
| 157 | { | - | ||||||||||||||||||
| 158 | return executed 8 times by 1 test: msg.createErrorReply(QDBusError::UnknownInterface,return msg.createErrorReply(QDBusError::UnknownInterface, QString::fromLatin1("Interface %1 was not found in object %2") .arg(interface_name) .arg(msg.path()));Executed by:
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:
| 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:
| 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:
| 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:
| 8 | ||||||||||||||||||
| 162 | } | - | ||||||||||||||||||
| 163 | - | |||||||||||||||||||
| 164 | static inline QDBusMessage | - | ||||||||||||||||||
| 165 | propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, const QByteArray &property_name) | - | ||||||||||||||||||
| 166 | { | - | ||||||||||||||||||
| 167 | return never executed: msg.createErrorReply(QDBusError::UnknownProperty,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()));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 | - | |||||||||||||||||||
| 175 | QDBusMessage 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
| 16-26 | ||||||||||||||||||
| 196 | (
| 0-26 | ||||||||||||||||||
| 197 | - | |||||||||||||||||||
| 198 | - | |||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | if (interface_name.isEmpty()
| 12-14 | ||||||||||||||||||
| 201 | for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(), | - | ||||||||||||||||||
| 202 | end = connector->adaptors.constEnd(); it != end
| 4-38 | ||||||||||||||||||
| 203 | const QMetaObject *mo = it->adaptor->metaObject(); | - | ||||||||||||||||||
| 204 | int pidx = mo->indexOfProperty(property_name); | - | ||||||||||||||||||
| 205 | if (pidx != -1
| 8-30 | ||||||||||||||||||
| 206 | value = mo->property(pidx).read(it->adaptor); | - | ||||||||||||||||||
| 207 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||
| 208 | } | - | ||||||||||||||||||
| 209 | } executed 30 times by 1 test: end of blockExecuted by:
| 30 | ||||||||||||||||||
| 210 | } executed 12 times by 1 test: else {end of blockExecuted by:
| 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()
| 0-14 | ||||||||||||||||||
| 215 | interfaceFound = true; | - | ||||||||||||||||||
| 216 | value = it->adaptor->property(property_name); | - | ||||||||||||||||||
| 217 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||
| 218 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||
| 219 | } | - | ||||||||||||||||||
| 220 | - | |||||||||||||||||||
| 221 | if (!interfaceFound
| 8-30 | ||||||||||||||||||
| 222 | && node.flags & (QDBusConnection::ExportAllProperties |
| 6-16 | ||||||||||||||||||
| 223 | QDBusConnection::ExportNonScriptableProperties)
| 6-16 | ||||||||||||||||||
| 224 | - | |||||||||||||||||||
| 225 | if (!interface_name.isEmpty()
| 0-16 | ||||||||||||||||||
| 226 | interfaceFound = qDBusInterfaceInObject(node.obj, interface_name); executed 16 times by 2 tests: interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);Executed by:
| 16 | ||||||||||||||||||
| 227 | - | |||||||||||||||||||
| 228 | if (interfaceFound
| 0-16 | ||||||||||||||||||
| 229 | int pidx = node.obj->metaObject()->indexOfProperty(property_name); | - | ||||||||||||||||||
| 230 | if (pidx != -1
| 0-16 | ||||||||||||||||||
| 231 | QMetaProperty mp = node.obj->metaObject()->property(pidx); | - | ||||||||||||||||||
| 232 | if ((mp.isScriptable()
| 0-16 | ||||||||||||||||||
| 233 | (!mp.isScriptable()
| 0 | ||||||||||||||||||
| 234 | value = mp.read(node.obj); executed 16 times by 2 tests: value = mp.read(node.obj);Executed by:
| 16 | ||||||||||||||||||
| 235 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 236 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 237 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | if (!value.isValid()
| 6-36 | ||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | if (!interfaceFound
| 0-6 | ||||||||||||||||||
| 242 | return executed 6 times by 1 test: interfaceNotFoundError(msg, interface_name);return interfaceNotFoundError(msg, interface_name);Executed by:
executed 6 times by 1 test: return interfaceNotFoundError(msg, interface_name);Executed by:
| 6 | ||||||||||||||||||
| 243 | return never executed: propertyNotFoundError(msg, interface_name, property_name);return 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: msg.createReply(QVariant::fromValue(QDBusVariant(value)));return msg.createReply(QVariant::fromValue(QDBusVariant(value)));Executed by:
executed 36 times by 3 tests: return msg.createReply(QVariant::fromValue(QDBusVariant(value)));Executed by:
| 36 | ||||||||||||||||||
| 247 | } | - | ||||||||||||||||||
| 248 | - | |||||||||||||||||||
| 249 | enum PropertyWriteResult { | - | ||||||||||||||||||
| 250 | PropertyWriteSuccess = 0, | - | ||||||||||||||||||
| 251 | PropertyNotFound, | - | ||||||||||||||||||
| 252 | PropertyTypeMismatch, | - | ||||||||||||||||||
| 253 | PropertyReadOnly, | - | ||||||||||||||||||
| 254 | PropertyWriteFailed | - | ||||||||||||||||||
| 255 | }; | - | ||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | static QDBusMessage propertyWriteReply(const QDBusMessage &msg, const QString &interface_name, | - | ||||||||||||||||||
| 258 | const QByteArray &property_name, int status) | - | ||||||||||||||||||
| 259 | { | - | ||||||||||||||||||
| 260 | switch (status) { | - | ||||||||||||||||||
| 261 | case never executed: PropertyNotFound:case PropertyNotFound:never executed: case PropertyNotFound: | 0 | ||||||||||||||||||
| 262 | return never executed: propertyNotFoundError(msg, interface_name, property_name);return propertyNotFoundError(msg, interface_name, property_name);never executed: return propertyNotFoundError(msg, interface_name, property_name); | 0 | ||||||||||||||||||
| 263 | case never executed: PropertyTypeMismatch:case PropertyTypeMismatch:never executed: case PropertyTypeMismatch: | 0 | ||||||||||||||||||
| 264 | return never executed: msg.createErrorReply(QDBusError::InvalidArgs,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)));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: PropertyReadOnly:case PropertyReadOnly:Executed by:
executed 6 times by 1 test: case PropertyReadOnly:Executed by:
| 6 | ||||||||||||||||||
| 270 | return executed 6 times by 1 test: msg.createErrorReply(QDBusError::PropertyReadOnly,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:
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:
| 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:
| 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:
| 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:
| 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:
| 6 | ||||||||||||||||||
| 275 | case never executed: PropertyWriteFailed:case PropertyWriteFailed:never executed: case PropertyWriteFailed: | 0 | ||||||||||||||||||
| 276 | return never executed: msg.createErrorReply(QDBusError::InternalError,return msg.createErrorReply(QDBusError::InternalError, QString::fromLatin1("Internal error"));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: PropertyWriteSuccess:case PropertyWriteSuccess:Executed by:
executed 22 times by 3 tests: case PropertyWriteSuccess:Executed by:
| 22 | ||||||||||||||||||
| 280 | return executed 22 times by 3 tests: msg.createReply();return msg.createReply();Executed by:
executed 22 times by 3 tests: return msg.createReply();Executed by:
| 22 | ||||||||||||||||||
| 281 | } | - | ||||||||||||||||||
| 282 | ((!(false)) ? qt_assert_x("", "Should not be reached",__FILE__,325) : qt_noop()); | - | ||||||||||||||||||
| 283 | return never executed: QDBusMessage();return QDBusMessage();never executed: return QDBusMessage(); | 0 | ||||||||||||||||||
| 284 | } | - | ||||||||||||||||||
| 285 | - | |||||||||||||||||||
| 286 | static 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
| 0-28 | ||||||||||||||||||
| 292 | - | |||||||||||||||||||
| 293 | return never executed: PropertyNotFound;return PropertyNotFound;never executed: return PropertyNotFound; | 0 | ||||||||||||||||||
| 294 | } | - | ||||||||||||||||||
| 295 | - | |||||||||||||||||||
| 296 | QMetaProperty mp = mo->property(pidx); | - | ||||||||||||||||||
| 297 | - | |||||||||||||||||||
| 298 | - | |||||||||||||||||||
| 299 | if (!mp.isWritable()
| 6-22 | ||||||||||||||||||
| 300 | return executed 6 times by 1 test: PropertyReadOnly;return PropertyReadOnly;Executed by:
executed 6 times by 1 test: return PropertyReadOnly;Executed by:
| 6 | ||||||||||||||||||
| 301 | - | |||||||||||||||||||
| 302 | - | |||||||||||||||||||
| 303 | bool isScriptable = mp.isScriptable(); | - | ||||||||||||||||||
| 304 | if (!(propFlags & QDBusConnection::ExportScriptableProperties)
| 0-22 | ||||||||||||||||||
| 305 | return never executed: PropertyNotFound;return PropertyNotFound;never executed: return PropertyNotFound; | 0 | ||||||||||||||||||
| 306 | if (!(propFlags & QDBusConnection::ExportNonScriptableProperties)
| 0-12 | ||||||||||||||||||
| 307 | return never executed: PropertyNotFound;return PropertyNotFound;never executed: return PropertyNotFound; | 0 | ||||||||||||||||||
| 308 | - | |||||||||||||||||||
| 309 | - | |||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | int id = mp.userType(); | - | ||||||||||||||||||
| 312 | if (!id
| 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: PropertyWriteFailed;return PropertyWriteFailed;never executed: return PropertyWriteFailed; | 0 | ||||||||||||||||||
| 317 | } | - | ||||||||||||||||||
| 318 | - | |||||||||||||||||||
| 319 | if (id != QMetaType::QVariant
| 0-22 | ||||||||||||||||||
| 320 | - | |||||||||||||||||||
| 321 | void *null = 0; | - | ||||||||||||||||||
| 322 | QVariant other(id, null); | - | ||||||||||||||||||
| 323 | if (!QDBusMetaType::demarshall(qvariant_cast<QDBusArgument>(value), id, other.data())
| 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: PropertyWriteFailed;return PropertyWriteFailed;never executed: return PropertyWriteFailed; | 0 | ||||||||||||||||||
| 328 | } | - | ||||||||||||||||||
| 329 | - | |||||||||||||||||||
| 330 | value = other; | - | ||||||||||||||||||
| 331 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||
| 332 | - | |||||||||||||||||||
| 333 | if (mp.userType() == qMetaTypeId<QDBusVariant>()
| 4-18 | ||||||||||||||||||
| 334 | value = QVariant::fromValue(QDBusVariant(value)); executed 4 times by 1 test: value = QVariant::fromValue(QDBusVariant(value));Executed by:
| 4 | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | - | |||||||||||||||||||
| 337 | return executed 22 times by 3 tests: mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;Executed by:
executed 22 times by 3 tests: return mp.write(obj, value) ? PropertyWriteSuccess : PropertyWriteFailed;Executed by:
| 22 | ||||||||||||||||||
| 338 | } | - | ||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | QDBusMessage 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
| 12-16 | ||||||||||||||||||
| 360 | (
| 0-12 | ||||||||||||||||||
| 361 | - | |||||||||||||||||||
| 362 | - | |||||||||||||||||||
| 363 | - | |||||||||||||||||||
| 364 | if (interface_name.isEmpty()
| 0-12 | ||||||||||||||||||
| 365 | for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(), | - | ||||||||||||||||||
| 366 | end = connector->adaptors.constEnd(); it != end
| 0 | ||||||||||||||||||
| 367 | int status = writeProperty(it->adaptor, property_name, value); | - | ||||||||||||||||||
| 368 | if (status == PropertyNotFound
| 0 | ||||||||||||||||||
| 369 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 370 | return never executed: propertyWriteReply(msg, interface_name, property_name, status);return propertyWriteReply(msg, interface_name, property_name, status);never executed: return propertyWriteReply(msg, interface_name, property_name, status); | 0 | ||||||||||||||||||
| 371 | } | - | ||||||||||||||||||
| 372 | } never executed: else {end of block | 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()
| 0-12 | ||||||||||||||||||
| 377 | return executed 12 times by 1 test: propertyWriteReply(msg, interface_name, property_name,return propertyWriteReply(msg, interface_name, property_name, writeProperty(it->adaptor, property_name, value));Executed by:
executed 12 times by 1 test: return propertyWriteReply(msg, interface_name, property_name, writeProperty(it->adaptor, property_name, value));Executed by:
| 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:
| 12 | ||||||||||||||||||
| 379 | } | - | ||||||||||||||||||
| 380 | } never executed: end of block | 0 | ||||||||||||||||||
| 381 | } | - | ||||||||||||||||||
| 382 | - | |||||||||||||||||||
| 383 | if (node.flags & (QDBusConnection::ExportScriptableProperties |
| 0-16 | ||||||||||||||||||
| 384 | QDBusConnection::ExportNonScriptableProperties)
| 0-16 | ||||||||||||||||||
| 385 | - | |||||||||||||||||||
| 386 | bool interfaceFound = true; | - | ||||||||||||||||||
| 387 | if (!interface_name.isEmpty()
| 0-16 | ||||||||||||||||||
| 388 | interfaceFound = qDBusInterfaceInObject(node.obj, interface_name); executed 16 times by 2 tests: interfaceFound = qDBusInterfaceInObject(node.obj, interface_name);Executed by:
| 16 | ||||||||||||||||||
| 389 | - | |||||||||||||||||||
| 390 | if (interfaceFound
| 0-16 | ||||||||||||||||||
| 391 | return executed 16 times by 2 tests: propertyWriteReply(msg, interface_name, property_name,return propertyWriteReply(msg, interface_name, property_name, writeProperty(node.obj, property_name, value, node.flags));Executed by:
executed 16 times by 2 tests: return propertyWriteReply(msg, interface_name, property_name, writeProperty(node.obj, property_name, value, node.flags));Executed by:
| 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:
| 16 | ||||||||||||||||||
| 393 | } | - | ||||||||||||||||||
| 394 | } never executed: end of block | 0 | ||||||||||||||||||
| 395 | - | |||||||||||||||||||
| 396 | - | |||||||||||||||||||
| 397 | if (!interface_name.isEmpty()
| 0 | ||||||||||||||||||
| 398 | return never executed: interfaceNotFoundError(msg, interface_name);return interfaceNotFoundError(msg, interface_name);never executed: return interfaceNotFoundError(msg, interface_name); | 0 | ||||||||||||||||||
| 399 | return never executed: propertyWriteReply(msg, interface_name, property_name, PropertyNotFound);return propertyWriteReply(msg, interface_name, property_name, PropertyNotFound);never executed: return propertyWriteReply(msg, interface_name, property_name, PropertyNotFound); | 0 | ||||||||||||||||||
| 400 | } | - | ||||||||||||||||||
| 401 | - | |||||||||||||||||||
| 402 | - | |||||||||||||||||||
| 403 | static QVariantMap &operator+=(QVariantMap &lhs, const QVariantMap &rhs) | - | ||||||||||||||||||
| 404 | { | - | ||||||||||||||||||
| 405 | QVariantMap::ConstIterator it = rhs.constBegin(), | - | ||||||||||||||||||
| 406 | end = rhs.constEnd(); | - | ||||||||||||||||||
| 407 | for ( ; it != end
| 16-32 | ||||||||||||||||||
| 408 | lhs.insert(it.key(), it.value()); executed 32 times by 1 test: lhs.insert(it.key(), it.value());Executed by:
| 32 | ||||||||||||||||||
| 409 | return executed 16 times by 1 test: lhs;return lhs;Executed by:
executed 16 times by 1 test: return lhs;Executed by:
| 16 | ||||||||||||||||||
| 410 | } | - | ||||||||||||||||||
| 411 | - | |||||||||||||||||||
| 412 | static 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()
| 22-54 | ||||||||||||||||||
| 419 | QMetaProperty mp = mo->property(i); | - | ||||||||||||||||||
| 420 | - | |||||||||||||||||||
| 421 | - | |||||||||||||||||||
| 422 | if (!mp.isReadable()
| 0-54 | ||||||||||||||||||
| 423 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 424 | - | |||||||||||||||||||
| 425 | - | |||||||||||||||||||
| 426 | int typeId = mp.userType(); | - | ||||||||||||||||||
| 427 | if (!typeId
| 0-54 | ||||||||||||||||||
| 428 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 429 | const char *signature = QDBusMetaType::typeToSignature(typeId); | - | ||||||||||||||||||
| 430 | if (!signature
| 6-48 | ||||||||||||||||||
| 431 | continue; executed 6 times by 1 test: continue;Executed by:
| 6 | ||||||||||||||||||
| 432 | - | |||||||||||||||||||
| 433 | - | |||||||||||||||||||
| 434 | if ((mp.isScriptable()
| 0-48 | ||||||||||||||||||
| 435 | (!mp.isScriptable()
| 0 | ||||||||||||||||||
| 436 | - | |||||||||||||||||||
| 437 | QVariant value = mp.read(object); | - | ||||||||||||||||||
| 438 | if (value.isValid()
| 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:
| 48 | ||||||||||||||||||
| 440 | } executed 48 times by 1 test: end of blockExecuted by:
| 48 | ||||||||||||||||||
| 441 | } executed 48 times by 1 test: end of blockExecuted by:
| 48 | ||||||||||||||||||
| 442 | - | |||||||||||||||||||
| 443 | return executed 22 times by 1 test: result;return result;Executed by:
executed 22 times by 1 test: return result;Executed by:
| 22 | ||||||||||||||||||
| 444 | } | - | ||||||||||||||||||
| 445 | - | |||||||||||||||||||
| 446 | QDBusMessage 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
| 0-12 | ||||||||||||||||||
| 467 | (
| 0-12 | ||||||||||||||||||
| 468 | - | |||||||||||||||||||
| 469 | if (interface_name.isEmpty()
| 4-8 | ||||||||||||||||||
| 470 | - | |||||||||||||||||||
| 471 | for (QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(), | - | ||||||||||||||||||
| 472 | end = connector->adaptors.constEnd(); it != end
| 4-16 | ||||||||||||||||||
| 473 | result += readAllProperties(it->adaptor, QDBusConnection::ExportAllProperties); | - | ||||||||||||||||||
| 474 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 475 | } executed 4 times by 1 test: else {end of blockExecuted by:
| 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()
| 0-8 | ||||||||||||||||||
| 481 | interfaceFound = true; | - | ||||||||||||||||||
| 482 | result = readAllProperties(it->adaptor, QDBusConnection::ExportAllProperties); | - | ||||||||||||||||||
| 483 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||
| 484 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||
| 485 | } | - | ||||||||||||||||||
| 486 | - | |||||||||||||||||||
| 487 | if (node.flags & QDBusConnection::ExportAllProperties
| 0-12 | ||||||||||||||||||
| 488 | (!interfaceFound
| 0 | ||||||||||||||||||
| 489 | - | |||||||||||||||||||
| 490 | result += readAllProperties(node.obj, node.flags); | - | ||||||||||||||||||
| 491 | interfaceFound = true; | - | ||||||||||||||||||
| 492 | } never executed: end of block | 0 | ||||||||||||||||||
| 493 | - | |||||||||||||||||||
| 494 | if (!interfaceFound
| 2-6 | ||||||||||||||||||
| 495 | - | |||||||||||||||||||
| 496 | return executed 2 times by 1 test: interfaceNotFoundError(msg, interface_name);return interfaceNotFoundError(msg, interface_name);Executed by:
executed 2 times by 1 test: return interfaceNotFoundError(msg, interface_name);Executed by:
| 2 | ||||||||||||||||||
| 497 | } | - | ||||||||||||||||||
| 498 | - | |||||||||||||||||||
| 499 | return executed 10 times by 1 test: msg.createReply(QVariant::fromValue(result));return msg.createReply(QVariant::fromValue(result));Executed by:
executed 10 times by 1 test: return msg.createReply(QVariant::fromValue(result));Executed by:
| 10 | ||||||||||||||||||
| 500 | } | - | ||||||||||||||||||
| 501 | - | |||||||||||||||||||
| 502 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |