From 43b0e2a74c12df59afa23758154ce416957bbb31 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 31 Jan 2011 10:25:14 +0200 Subject: [PATCH] GUI: Fill summary data when reading XML file. When reading XML file there is no summary data stored so we must dublicate the message data to summary. Since message can be long try to find full stop from the message and cut summary to it. Ticket: #2402 ([GUI] Summary is not shown for loaded .xml file) --- gui/xmlreport.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/xmlreport.cpp b/gui/xmlreport.cpp index c82478055..f481f3615 100644 --- a/gui/xmlreport.cpp +++ b/gui/xmlreport.cpp @@ -159,6 +159,16 @@ ErrorLine XmlReport::ReadError(QXmlStreamReader *reader) line.line = attribs.value("", LineAttribute).toString().toUInt(); line.id = attribs.value("", IdAttribute).toString(); line.severity = attribs.value("", SeverityAttribute).toString(); + + // NOTE: This dublicates the message to Summary-field. But since + // old XML format doesn't have separate summary and verbose messages + // we must add same message to both data so it shows up in GUI. + // Check if there is full stop and cut the summary to it. + QString summary = attribs.value("", MsgAttribute).toString(); + const int ind = summary.indexOf('.'); + if (ind != -1) + summary = summary.left(ind + 1); + line.summary = summary; line.message = attribs.value("", MsgAttribute).toString(); } return line;