MCPcopy Create free account
hub / github.com/brezerk/q4wine / parseComment

Method parseComment

src/core/xmlparser.cpp:381–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381void 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
407QString XmlParser::getChildNodeData(const QDomNode &childNode) {
408 QString data;

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected