From 8ad9bf604ed0f95f486ea438385b0608ad60f635 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Tue, 21 Jun 2011 12:27:57 +0200 Subject: [PATCH] Improving DOM view of messages --- src/ui/mavlink/DomModel.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ui/mavlink/DomModel.cc b/src/ui/mavlink/DomModel.cc index b8328fd..e084e9a 100644 --- a/src/ui/mavlink/DomModel.cc +++ b/src/ui/mavlink/DomModel.cc @@ -36,7 +36,26 @@ QVariant DomModel::data(const QModelIndex &index, int role) const switch (index.column()) { case 0: - return node.nodeName(); + { + if (node.nodeName() == "message") + { + for (int i = 0; i < attributeMap.count(); ++i) { + QDomNode attribute = attributeMap.item(i); + if (attribute.nodeName() == "name") return attribute.nodeValue(); + } + } + if (node.nodeName() == "field") + { + for (int i = 0; i < attributeMap.count(); ++i) { + QDomNode attribute = attributeMap.item(i); + if (attribute.nodeName() == "name") return attribute.nodeValue(); + } + } + else + { + return node.nodeName(); + } + } case 1: for (int i = 0; i < attributeMap.count(); ++i) { QDomNode attribute = attributeMap.item(i);