Skip to content

Commit 1e338e5

Browse files
committed
gui
1 parent 759e1d1 commit 1e338e5

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

gui/erroritem.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ ErrorItem::ErrorItem(const ErrorMessage &errmsg)
5151
, cwe(errmsg.cwe.id)
5252
, hash(errmsg.hash)
5353
, symbolNames(QString::fromStdString(errmsg.symbolNames()))
54+
, remark(QString::fromStdString(errmsg.remark))
5455
{
55-
for (std::list<ErrorMessage::FileLocation>::const_iterator loc = errmsg.callStack.cbegin();
56-
loc != errmsg.callStack.cend();
57-
++loc) {
58-
errorPath << QErrorPathItem(*loc);
59-
}
56+
for (const auto& loc: errmsg.callStack)
57+
errorPath << QErrorPathItem(loc);
6058
}
6159

6260
QString ErrorItem::tool() const

gui/erroritem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class ErrorItem {
9191
unsigned long long hash;
9292
QList<QErrorPathItem> errorPath;
9393
QString symbolNames;
94+
QString remark;
9495

9596
// Special GUI properties
9697
QString sinceDate;
@@ -122,6 +123,7 @@ class ErrorLine {
122123
QString message;
123124
QString sinceDate;
124125
QString tags;
126+
QString remark;
125127
};
126128

127129
/// @}

gui/resultstree.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static constexpr char SINCEDATE[] = "sinceDate";
7777
static constexpr char SYMBOLNAMES[] = "symbolNames";
7878
static constexpr char SUMMARY[] = "summary";
7979
static constexpr char TAGS[] = "tags";
80+
static constexpr char REMARK[] = "remark";
8081

8182
// These must match column headers given in ResultsTree::translate()
8283
static constexpr int COLUMN_SINCE_DATE = 6;
@@ -185,6 +186,7 @@ bool ResultsTree::addErrorItem(const ErrorItem &item)
185186
if (const ProjectFile *activeProject = ProjectFile::getActiveProject()) {
186187
line.tags = activeProject->getWarningTags(item.hash);
187188
}
189+
line.remark = item.remark;
188190
//Create the base item for the error and ensure it has a proper
189191
//file item as a parent
190192
QStandardItem* fileItem = ensureFileItem(loc.file, item.file0, hide);
@@ -213,6 +215,7 @@ bool ResultsTree::addErrorItem(const ErrorItem &item)
213215
data[SINCEDATE] = item.sinceDate;
214216
data[SYMBOLNAMES] = item.symbolNames;
215217
data[TAGS] = line.tags;
218+
data[REMARK] = line.remark;
216219
data[HIDE] = hide;
217220
stditem->setData(QVariant(data));
218221

@@ -1295,6 +1298,7 @@ void ResultsTree::readErrorItem(const QStandardItem *error, ErrorItem *item) con
12951298
item->file0 = data[FILE0].toString();
12961299
item->sinceDate = data[SINCEDATE].toString();
12971300
item->tags = data[TAGS].toString();
1301+
item->remark = data[REMARK].toString();
12981302

12991303
if (error->rowCount() == 0) {
13001304
QErrorPathItem e;

gui/xmlreportv2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ static const QString TagsAttribute = "tag";
4949
static const QString FilenameAttribute = "file";
5050
static const QString IncludedFromFilenameAttribute = "file0";
5151
static const QString InconclusiveAttribute = "inconclusive";
52+
static const QString RemarkAttribute = "remark";
5253
static const QString InfoAttribute = "info";
5354
static const QString LineAttribute = "line";
5455
static const QString ColumnAttribute = "column";
@@ -137,6 +138,8 @@ void XmlReportV2::writeError(const ErrorItem &error)
137138
mXmlWriter->writeAttribute(VerboseAttribute, message);
138139
if (error.inconclusive)
139140
mXmlWriter->writeAttribute(InconclusiveAttribute, "true");
141+
if (!error.remark.isEmpty())
142+
mXmlWriter->writeAttribute(RemarkAttribute, error.remark);
140143
if (error.cwe > 0)
141144
mXmlWriter->writeAttribute(CWEAttribute, QString::number(error.cwe));
142145
if (error.hash > 0)
@@ -231,6 +234,8 @@ ErrorItem XmlReportV2::readError(const QXmlStreamReader *reader)
231234
item.message = XmlReport::unquoteMessage(message);
232235
if (attribs.hasAttribute(QString(), InconclusiveAttribute))
233236
item.inconclusive = true;
237+
if (attribs.hasAttribute(QString(), RemarkAttribute))
238+
item.remark = attribs.value(QString(), RemarkAttribute).toString();
234239
if (attribs.hasAttribute(QString(), CWEAttribute))
235240
item.cwe = attribs.value(QString(), CWEAttribute).toInt();
236241
if (attribs.hasAttribute(QString(), HashAttribute))

0 commit comments

Comments
 (0)