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:
parent
800d8d1e05
commit
43b0e2a74c
|
@ -159,6 +159,16 @@ ErrorLine XmlReport::ReadError(QXmlStreamReader *reader)
|
||||||
line.line = attribs.value("", LineAttribute).toString().toUInt();
|
line.line = attribs.value("", LineAttribute).toString().toUInt();
|
||||||
line.id = attribs.value("", IdAttribute).toString();
|
line.id = attribs.value("", IdAttribute).toString();
|
||||||
line.severity = attribs.value("", SeverityAttribute).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();
|
line.message = attribs.value("", MsgAttribute).toString();
|
||||||
}
|
}
|
||||||
return line;
|
return line;
|
||||||
|
|
Loading…
Reference in New Issue