| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/dbus/qdbusxmlparser.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | - | |
| 2 | - | |
| 3 | - | |
| 4 | static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData, | - |
| 5 | QDBusIntrospection::Interface *ifaceData) | - |
| 6 | { | - |
| 7 | const QString argType = attributes.value(QLatin1String("type")).toString(); | - |
| 8 | - | |
| 9 | bool ok = QDBusUtil::isValidSingleSignature(argType); | - |
| 10 | if (!ok) { | - |
| 11 | if (true) {} else QMessageLogger(__FILE__, 6167, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found while parsing introspection", dead code: QMessageLogger(__FILE__, 67, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found while parsing introspection", QString(argType).toLocal8Bit().constData()); | - |
| 12 | QString(argType).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 67, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found while parsing introspection", QString(argType).toLocal8Bit().constData()); | - |
| 13 | } | - |
| 14 | - | |
| 15 | argData.name = attributes.value(QLatin1String("name")).toString(); | - |
| 16 | argData.type = argType; | - |
| 17 | - | |
| 18 | ifaceData->introspection += QLatin1String(" <arg"); | - |
| 19 | if (attributes.hasAttribute(QLatin1String("direction"))) { | - |
| 20 | const QString direction = attributes.value(QLatin1String("direction")).toString(); | - |
| 21 | ifaceData->introspection += QLatin1String(" direction=\"") + direction + QLatin1String("\""); | - |
| 22 | } | - |
| 23 | ifaceData->introspection += QLatin1String(" type=\"") + argData.type + QLatin1String("\""); | - |
| 24 | if (!argData.name.isEmpty()) | - |
| 25 | ifaceData->introspection += QLatin1String(" name=\"") + argData.name + QLatin1String("\""); | - |
| 26 | ifaceData->introspection += QLatin1String("/>\n"); | - |
| 27 | - | |
| 28 | return ok; | - |
| 29 | } | - |
| 30 | - | |
| 31 | static bool parseAnnotation(const QXmlStreamReader &xml, QDBusIntrospection::Annotations &annotations, | - |
| 32 | QDBusIntrospection::Interface *ifaceData, bool interfaceAnnotation = false) | - |
| 33 | { | - |
| 34 | ((!(xml.isStartElement() && xml.name() == QLatin1String("annotation"))) ? qt_assert("xml.isStartElement() && xml.name() == QLatin1String(\"annotation\")",__FILE__,8490) : qt_noop()); | - |
| 35 | - | |
| 36 | const QXmlStreamAttributes attributes = xml.attributes(); | - |
| 37 | const QString name = attributes.value(QLatin1String("name")).toString(); | - |
| 38 | - | |
| 39 | if (!QDBusUtil::isValidInterfaceName(name)) { | - |
| 40 | if (true) {} else QMessageLogger(__FILE__, 9096, __PRETTY_FUNCTION__).debug("Invalid D-BUS annotation '%s' found while parsing introspection", dead code: QMessageLogger(__FILE__, 96, __PRETTY_FUNCTION__).debug("Invalid D-BUS annotation '%s' found while parsing introspection", QString(name).toLocal8Bit().constData()); | - |
| 41 | QString(name).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 96, __PRETTY_FUNCTION__).debug("Invalid D-BUS annotation '%s' found while parsing introspection", QString(name).toLocal8Bit().constData()); | - |
| 42 | return false; | - |
| 43 | } | - |
| 44 | const QString value = attributes.value(QLatin1String("value")).toString(); | - |
| 45 | annotations.insert(name, value); | - |
| 46 | if (!interfaceAnnotation) | - |
| 47 | ifaceData->introspection += QLatin1String(" "); | - |
| 48 | ifaceData->introspection += QLatin1String(" <annotation value=\"") + value.toHtmlEscaped() + QLatin1String("\" name=\"") + name + QLatin1String("\"/>\n"); | - |
| 49 | return true; | - |
| 50 | } | - |
| 51 | - | |
| 52 | static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &propertyData, | - |
| 53 | QDBusIntrospection::Interface *ifaceData) | - |
| 54 | { | - |
| 55 | ((!(xml.isStartElement() && xml.name() == QLatin1String("property"))) ? qt_assert("xml.isStartElement() && xml.name() == QLatin1String(\"property\")",__FILE__,105111) : qt_noop()); | - |
| 56 | - | |
| 57 | QXmlStreamAttributes attributes = xml.attributes(); | - |
| 58 | const QString propertyName = attributes.value(QLatin1String("name")).toString(); | - |
| 59 | if (!QDBusUtil::isValidMemberName(propertyName)) { | - |
| 60 | if (true) {} else QMessageLogger(__FILE__, 110116, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", dead code: QMessageLogger(__FILE__, 116, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(propertyName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 61 | QString(propertyName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 116, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(propertyName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 62 | xml.skipCurrentElement(); | - |
| 63 | return false; | - |
| 64 | } | - |
| 65 | - | |
| 66 | - | |
| 67 | propertyData.name = propertyName; | - |
| 68 | propertyData.type = attributes.value(QLatin1String("type")).toString(); | - |
| 69 | - | |
| 70 | if (!QDBusUtil::isValidSingleSignature(propertyData.type)) { | - |
| 71 | - | |
| 72 | if (true) {} else QMessageLogger(__FILE__, 122128, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", dead code: QMessageLogger(__FILE__, 128, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 73 | QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), dead code: QMessageLogger(__FILE__, 128, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 74 | QString(propertyName).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 128, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 75 | } | - |
| 76 | - | |
| 77 | const QString access = attributes.value(QLatin1String("access")).toString(); | - |
| 78 | if (access == QLatin1String("read")) | - |
| 79 | propertyData.access = QDBusIntrospection::Property::Read; | - |
| 80 | else if (access == QLatin1String("write")) | - |
| 81 | propertyData.access = QDBusIntrospection::Property::Write; | - |
| 82 | else if (access == QLatin1String("readwrite")) | - |
| 83 | propertyData.access = QDBusIntrospection::Property::ReadWrite; | - |
| 84 | else { | - |
| 85 | if (true) {} else QMessageLogger(__FILE__, 135141, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", dead code: QMessageLogger(__FILE__, 141, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 86 | QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), dead code: QMessageLogger(__FILE__, 141, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 87 | QString(propertyName).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 141, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData()); | - |
| 88 | return false; | - |
| 89 | } | - |
| 90 | - | |
| 91 | ifaceData->introspection += QLatin1String(" <property access=\"") + access + QLatin1String("\" type=\"") + propertyData.type + QLatin1String("\" name=\"") + propertyName + QLatin1String("\""); | - |
| 92 | - | |
| 93 | if (!xml.readNextStartElement()) { | - |
| 94 | ifaceData->introspection += QLatin1String("/>\n"); | - |
| 95 | } else { | - |
| 96 | ifaceData->introspection += QLatin1String(">\n"); | - |
| 97 | - | |
| 98 | do { | - |
| 99 | if (xml.name() == QLatin1String("annotation")) { | - |
| 100 | parseAnnotation(xml, propertyData.annotations, ifaceData); | - |
| 101 | } else if (xml.prefix().isEmpty()) { | - |
| 102 | if (true) {} else QMessageLogger(__FILE__, 152158, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for annotations"; dead code: QMessageLogger(__FILE__, 158, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for annotations"; | - |
| 103 | } | - |
| 104 | xml.skipCurrentElement(); | - |
| 105 | } while (xml.readNextStartElement()); | - |
| 106 | - | |
| 107 | ifaceData->introspection += QLatin1String(" </property>\n"); | - |
| 108 | } | - |
| 109 | - | |
| 110 | if (!xml.isEndElement() || xml.name() != QLatin1String("property")) { | - |
| 111 | if (true) {} else QMessageLogger(__FILE__, 161167, __PRETTY_FUNCTION__).debug() << "Invalid property specification" << xml.tokenString() << xml.name(); dead code: QMessageLogger(__FILE__, 167, __PRETTY_FUNCTION__).debug() << "Invalid property specification" << xml.tokenString() << xml.name(); | - |
| 112 | return false; | - |
| 113 | } | - |
| 114 | - | |
| 115 | return true; | - |
| 116 | } | - |
| 117 | - | |
| 118 | static bool parseMethod(QXmlStreamReader &xml, QDBusIntrospection::Method &methodData, | - |
| 119 | QDBusIntrospection::Interface *ifaceData) | - |
| 120 | { | - |
| 121 | ((!(xml.isStartElement() && xml.name() == QLatin1String("method"))) ? qt_assert("xml.isStartElement() && xml.name() == QLatin1String(\"method\")",__FILE__,171177) : qt_noop()); | - |
| 122 | - | |
| 123 | const QXmlStreamAttributes attributes = xml.attributes(); | - |
| 124 | const QString methodName = attributes.value(QLatin1String("name")).toString(); | - |
| 125 | if (!QDBusUtil::isValidMemberName(methodName)) { | - |
| 126 | if (true) {} else QMessageLogger(__FILE__, 176182, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", dead code: QMessageLogger(__FILE__, 182, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(methodName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 127 | QString(methodName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 182, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(methodName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 128 | return false; | - |
| 129 | } | - |
| 130 | - | |
| 131 | methodData.name = methodName; | - |
| 132 | ifaceData->introspection += QLatin1String(" <method name=\"") + methodName + QLatin1String("\""); | - |
| 133 | - | |
| 134 | QDBusIntrospection::Arguments outArguments; | - |
| 135 | QDBusIntrospection::Arguments inArguments; | - |
| 136 | QDBusIntrospection::Annotations annotations; | - |
| 137 | - | |
| 138 | if (!xml.readNextStartElement()) { | - |
| 139 | ifaceData->introspection += QLatin1String("/>\n"); | - |
| 140 | } else { | - |
| 141 | ifaceData->introspection += QLatin1String(">\n"); | - |
| 142 | - | |
| 143 | do { | - |
| 144 | if (xml.name() == QLatin1String("annotation")) { | - |
| 145 | parseAnnotation(xml, annotations, ifaceData); | - |
| 146 | } else if (xml.name() == QLatin1String("arg")) { | - |
| 147 | const QXmlStreamAttributes attributes = xml.attributes(); | - |
| 148 | const QString direction = attributes.value(QLatin1String("direction")).toString(); | - |
| 149 | QDBusIntrospection::Argument argument; | - |
| 150 | if (!attributes.hasAttribute(QLatin1String("direction")) | - |
| 151 | || direction == QLatin1String("in")) { | - |
| 152 | parseArg(attributes, argument, ifaceData); | - |
| 153 | inArguments << argument; | - |
| 154 | } else if (direction == QLatin1String("out")) { | - |
| 155 | parseArg(attributes, argument, ifaceData); | - |
| 156 | outArguments << argument; | - |
| 157 | } | - |
| 158 | } else if (xml.prefix().isEmpty()) { | - |
| 159 | if (true) {} else QMessageLogger(__FILE__, 209215, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for method arguments"; dead code: QMessageLogger(__FILE__, 215, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for method arguments"; | - |
| 160 | } | - |
| 161 | xml.skipCurrentElement(); | - |
| 162 | } while (xml.readNextStartElement()); | - |
| 163 | - | |
| 164 | ifaceData->introspection += QLatin1String(" </method>\n"); | - |
| 165 | } | - |
| 166 | - | |
| 167 | methodData.inputArgs = inArguments; | - |
| 168 | methodData.outputArgs = outArguments; | - |
| 169 | methodData.annotations = annotations; | - |
| 170 | - | |
| 171 | return true; | - |
| 172 | } | - |
| 173 | - | |
| 174 | - | |
| 175 | static bool parseSignal(QXmlStreamReader &xml, QDBusIntrospection::Signal &signalData, | - |
| 176 | QDBusIntrospection::Interface *ifaceData) | - |
| 177 | { | - |
| 178 | ((!(xml.isStartElement() && xml.name() == QLatin1String("signal"))) ? qt_assert("xml.isStartElement() && xml.name() == QLatin1String(\"signal\")",__FILE__,228234) : qt_noop()); | - |
| 179 | - | |
| 180 | const QXmlStreamAttributes attributes = xml.attributes(); | - |
| 181 | const QString signalName = attributes.value(QLatin1String("name")).toString(); | - |
| 182 | - | |
| 183 | if (!QDBusUtil::isValidMemberName(signalName)) { | - |
| 184 | if (true) {} else QMessageLogger(__FILE__, 234240, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", dead code: QMessageLogger(__FILE__, 240, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(signalName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 185 | QString(signalName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 240, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(signalName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData()); | - |
| 186 | return false; | - |
| 187 | } | - |
| 188 | - | |
| 189 | signalData.name = signalName; | - |
| 190 | ifaceData->introspection += QLatin1String(" <signal name=\"") + signalName + QLatin1String("\""); | - |
| 191 | - | |
| 192 | QDBusIntrospection::Arguments arguments; | - |
| 193 | QDBusIntrospection::Annotations annotations; | - |
| 194 | - | |
| 195 | if (!xml.readNextStartElement()) { | - |
| 196 | ifaceData->introspection += QLatin1String("/>\n"); | - |
| 197 | } else { | - |
| 198 | ifaceData->introspection += QLatin1String(">\n"); | - |
| 199 | - | |
| 200 | do { | - |
| 201 | if (xml.name() == QLatin1String("annotation")) { | - |
| 202 | parseAnnotation(xml, annotations, ifaceData); | - |
| 203 | } else if (xml.name() == QLatin1String("arg")) { | - |
| 204 | const QXmlStreamAttributes attributes = xml.attributes(); | - |
| 205 | QDBusIntrospection::Argument argument; | - |
| 206 | if (!attributes.hasAttribute(QLatin1String("direction")) || | - |
| 207 | attributes.value(QLatin1String("direction")) == QLatin1String("out")) { | - |
| 208 | parseArg(attributes, argument, ifaceData); | - |
| 209 | arguments << argument; | - |
| 210 | } | - |
| 211 | } else { | - |
| 212 | if (true) {} else QMessageLogger(__FILE__, 262268, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for signal arguments"; dead code: QMessageLogger(__FILE__, 268, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for signal arguments"; | - |
| 213 | } | - |
| 214 | xml.skipCurrentElement(); | - |
| 215 | } while (xml.readNextStartElement()); | - |
| 216 | - | |
| 217 | ifaceData->introspection += QLatin1String(" </signal>\n"); | - |
| 218 | } | - |
| 219 | - | |
| 220 | signalData.outputArgs = arguments; | - |
| 221 | signalData.annotations = annotations; | - |
| 222 | - | |
| 223 | return true; | - |
| 224 | } | - |
| 225 | - | |
| 226 | static void readInterface(QXmlStreamReader &xml, QDBusIntrospection::Object *objData, | - |
| 227 | QDBusIntrospection::Interfaces *interfaces) | - |
| 228 | { | - |
| 229 | const QString ifaceName = xml.attributes().value(QLatin1String("name")).toString(); | - |
| 230 | if (!QDBusUtil::isValidInterfaceName(ifaceName)) { | - |
| 231 | if (true) {} else QMessageLogger(__FILE__, 281287, __PRETTY_FUNCTION__).debug("Invalid D-BUS interface name '%s' found while parsing introspection", dead code: QMessageLogger(__FILE__, 287, __PRETTY_FUNCTION__).debug("Invalid D-BUS interface name '%s' found while parsing introspection", QString(ifaceName).toLocal8Bit().constData()); | - |
| 232 | QString(ifaceName).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 287, __PRETTY_FUNCTION__).debug("Invalid D-BUS interface name '%s' found while parsing introspection", QString(ifaceName).toLocal8Bit().constData()); | - |
| 233 | return; | - |
| 234 | } | - |
| 235 | - | |
| 236 | objData->interfaces.append(ifaceName); | - |
| 237 | - | |
| 238 | QDBusIntrospection::Interface *ifaceData = new QDBusIntrospection::Interface; | - |
| 239 | ifaceData->name = ifaceName; | - |
| 240 | ifaceData->introspection += QLatin1String(" <interface name=\"") + ifaceName + QLatin1String("\">\n"); | - |
| 241 | - | |
| 242 | while (xml.readNextStartElement()) { | - |
| 243 | if (xml.name() == QLatin1String("method")) { | - |
| 244 | QDBusIntrospection::Method methodData; | - |
| 245 | if (parseMethod(xml, methodData, ifaceData)) | - |
| 246 | ifaceData->methods.insert(methodData.name, methodData); | - |
| 247 | } else if (xml.name() == QLatin1String("signal")) { | - |
| 248 | QDBusIntrospection::Signal signalData; | - |
| 249 | if (parseSignal(xml, signalData, ifaceData)) | - |
| 250 | ifaceData->signals_.insert(signalData.name, signalData); | - |
| 251 | } else if (xml.name() == QLatin1String("property")) { | - |
| 252 | QDBusIntrospection::Property propertyData; | - |
| 253 | if (parseProperty(xml, propertyData, ifaceData)) | - |
| 254 | ifaceData->properties.insert(propertyData.name, propertyData); | - |
| 255 | } else if (xml.name() == QLatin1String("annotation")) { | - |
| 256 | parseAnnotation(xml, ifaceData->annotations, ifaceData, true); | - |
| 257 | xml.skipCurrentElement(); | - |
| 258 | } else { | - |
| 259 | if (xml.prefix().isEmpty()) { | - |
| 260 | if (true) {} else QMessageLogger(__FILE__, 310316, __PRETTY_FUNCTION__).debug() << "Unknown element while parsing interface" << xml.name(); dead code: QMessageLogger(__FILE__, 316, __PRETTY_FUNCTION__).debug() << "Unknown element while parsing interface" << xml.name(); | - |
| 261 | } | - |
| 262 | xml.skipCurrentElement(); | - |
| 263 | } | - |
| 264 | } | - |
| 265 | - | |
| 266 | ifaceData->introspection += QLatin1String(" </interface>"); | - |
| 267 | - | |
| 268 | interfaces->insert(ifaceName, QSharedDataPointer<QDBusIntrospection::Interface>(ifaceData)); | - |
| 269 | - | |
| 270 | if (!xml.isEndElement() || xml.name() != QLatin1String("interface")) { | - |
| 271 | if (true) {} else QMessageLogger(__FILE__, 321327, __PRETTY_FUNCTION__).debug() << "Invalid Interface specification"; dead code: QMessageLogger(__FILE__, 327, __PRETTY_FUNCTION__).debug() << "Invalid Interface specification"; | - |
| 272 | } | - |
| 273 | } | - |
| 274 | - | |
| 275 | static void readNode(const QXmlStreamReader &xml, QDBusIntrospection::Object *objData, int nodeLevel) | - |
| 276 | { | - |
| 277 | const QString objName = xml.attributes().value(QLatin1String("name")).toString(); | - |
| 278 | const QString fullName = objData->path.endsWith(QLatin1Char('/')) | - |
| 279 | ? (objData->path + objName) | - |
| 280 | : QString(objData->path + QLatin1Char('/') + objName); | - |
| 281 | if (!QDBusUtil::isValidObjectPath(fullName)) { | - |
| 282 | if (true) {} else QMessageLogger(__FILE__, 332338, __PRETTY_FUNCTION__).debug("Invalid D-BUS object path '%s' found while parsing introspection", dead code: QMessageLogger(__FILE__, 338, __PRETTY_FUNCTION__).debug("Invalid D-BUS object path '%s' found while parsing introspection", QString(fullName).toLocal8Bit().constData()); | - |
| 283 | QString(fullName).toLocal8Bit().constData()); dead code: QMessageLogger(__FILE__, 338, __PRETTY_FUNCTION__).debug("Invalid D-BUS object path '%s' found while parsing introspection", QString(fullName).toLocal8Bit().constData()); | - |
| 284 | return; | - |
| 285 | } | - |
| 286 | - | |
| 287 | if (nodeLevel > 0) | - |
| 288 | objData->childObjects.append(objName); | - |
| 289 | } | - |
| 290 | - | |
| 291 | QDBusXmlParser::QDBusXmlParser(const QString& service, const QString& path, | - |
| 292 | const QString& xmlData) | - |
| 293 | : m_service(service), m_path(path), m_object(new QDBusIntrospection::Object) | - |
| 294 | { | - |
| 295 | - | |
| 296 | - | |
| 297 | m_object->service = m_service; | - |
| 298 | m_object->path = m_path; | - |
| 299 | - | |
| 300 | QXmlStreamReader xml(xmlData); | - |
| 301 | - | |
| 302 | int nodeLevel = -1; | - |
| 303 | - | |
| 304 | while (!xml.atEnd()) { | - |
| 305 | xml.readNext(); | - |
| 306 | - | |
| 307 | switch (xml.tokenType()) { | - |
| 308 | case QXmlStreamReader::StartElement: | - |
| 309 | if (xml.name() == QLatin1String("node")) { | - |
| 310 | readNode(xml, m_object, ++nodeLevel); | - |
| 311 | } else if (xml.name() == QLatin1String("interface")) { | - |
| 312 | readInterface(xml, m_object, &m_interfaces); | - |
| 313 | } else { | - |
| 314 | if (xml.prefix().isEmpty()) { | - |
| 315 | if (true) {} else QMessageLogger(__FILE__, 365371, __PRETTY_FUNCTION__).debug() << "skipping unknown element" << xml.name(); dead code: QMessageLogger(__FILE__, 371, __PRETTY_FUNCTION__).debug() << "skipping unknown element" << xml.name(); | - |
| 316 | } | - |
| 317 | xml.skipCurrentElement(); | - |
| 318 | } | - |
| 319 | break; | - |
| 320 | case QXmlStreamReader::EndElement: | - |
| 321 | if (xml.name() == QLatin1String("node")) { | - |
| 322 | --nodeLevel; | - |
| 323 | } else { | - |
| 324 | if (true) {} else QMessageLogger(__FILE__, 374380, __PRETTY_FUNCTION__).debug() << "Invalid Node declaration" << xml.name(); dead code: QMessageLogger(__FILE__, 380, __PRETTY_FUNCTION__).debug() << "Invalid Node declaration" << xml.name(); | - |
| 325 | } | - |
| 326 | break; | - |
| 327 | case QXmlStreamReader::StartDocument: | - |
| 328 | case QXmlStreamReader::EndDocument: | - |
| 329 | case QXmlStreamReader::DTD: | - |
| 330 | - | |
| 331 | break; | - |
| 332 | case QXmlStreamReader::Comment: | - |
| 333 | - | |
| 334 | break; | - |
| 335 | default: | - |
| 336 | if (true) {} else QMessageLogger(__FILE__, 386392, __PRETTY_FUNCTION__).debug() << "unknown token" << xml.name() << xml.tokenString(); dead code: QMessageLogger(__FILE__, 392, __PRETTY_FUNCTION__).debug() << "unknown token" << xml.name() << xml.tokenString(); | - |
| 337 | break; | - |
| 338 | } | - |
| 339 | } | - |
| 340 | - | |
| 341 | if (xml.hasError()) { | - |
| 342 | if (true) {} else QMessageLogger(__FILE__, 392398, __PRETTY_FUNCTION__).debug() << "xml error" << xml.errorString() << "doc" << xmlData; dead code: QMessageLogger(__FILE__, 398, __PRETTY_FUNCTION__).debug() << "xml error" << xml.errorString() << "doc" << xmlData; | - |
| 343 | } | - |
| 344 | } | - |
| 345 | - | |
| 346 | - | |
| Switch to Source code | Preprocessed file |