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)
This commit is contained in:
Kimmo Varis 2011-01-31 10:25:14 +02:00
parent 800d8d1e05
commit 43b0e2a74c
1 changed files with 10 additions and 0 deletions

View File

@ -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;