| 379 | } |
| 380 | |
| 381 | void XmlParser::parseComment(const QDomElement &element, |
| 382 | WineAppDBInfo &appinfo) { |
| 383 | WineAppDBComment comment; |
| 384 | QDomNode node = element.firstChild(); |
| 385 | |
| 386 | while (!node.isNull()) { |
| 387 | if (node.toElement().tagName() == "topic") { |
| 388 | comment.topic = getChildNodeData(node.firstChild()); |
| 389 | comment.id = element.attribute("id").toInt(); |
| 390 | } else if (node.toElement().tagName() == "date") { |
| 391 | comment.date = getChildNodeData(node.firstChild()); |
| 392 | } else if (node.toElement().tagName() == "author") { |
| 393 | comment.author = getChildNodeData(node.firstChild()); |
| 394 | } else if (node.toElement().tagName() == "parent") { |
| 395 | comment.parent_id = getChildNodeData(node.firstChild()).toInt(); |
| 396 | } else if (node.toElement().tagName() == "message") { |
| 397 | comment.message = getChildNodeData(node.firstChild()); |
| 398 | } |
| 399 | |
| 400 | node = node.nextSibling(); |
| 401 | } |
| 402 | |
| 403 | appinfo.comments.append(comment); |
| 404 | return; |
| 405 | } |
| 406 | |
| 407 | QString XmlParser::getChildNodeData(const QDomNode &childNode) { |
| 408 | QString data; |