GUI: Rename ErrorItem::id to ErrorItem::errorId.
This commit is contained in:
parent
b73896bcc5
commit
4c24b6a804
|
@ -29,7 +29,7 @@ ErrorItem::ErrorItem(const ErrorItem &item)
|
||||||
file = item.file;
|
file = item.file;
|
||||||
files = item.files;
|
files = item.files;
|
||||||
lines = item.lines;
|
lines = item.lines;
|
||||||
id = item.id;
|
errorId = item.errorId;
|
||||||
inconclusive = item.inconclusive;
|
inconclusive = item.inconclusive;
|
||||||
severity = item.severity;
|
severity = item.severity;
|
||||||
summary = item.summary;
|
summary = item.summary;
|
||||||
|
@ -41,7 +41,7 @@ ErrorItem::ErrorItem(const ErrorLine &line)
|
||||||
file = line.file;
|
file = line.file;
|
||||||
files.append(line.file);
|
files.append(line.file);
|
||||||
lines.append(line.line);
|
lines.append(line.line);
|
||||||
id = line.id;
|
errorId = line.errorId;
|
||||||
inconclusive = line.inconclusive;
|
inconclusive = line.inconclusive;
|
||||||
severity = line.severity;
|
severity = line.severity;
|
||||||
summary = line.summary;
|
summary = line.summary;
|
||||||
|
@ -50,7 +50,7 @@ ErrorItem::ErrorItem(const ErrorLine &line)
|
||||||
|
|
||||||
QString ErrorItem::ToString() const
|
QString ErrorItem::ToString() const
|
||||||
{
|
{
|
||||||
QString str = file + " - " + id + " - ";
|
QString str = file + " - " + errorId + " - ";
|
||||||
if (inconclusive)
|
if (inconclusive)
|
||||||
str += "inconclusive ";
|
str += "inconclusive ";
|
||||||
str += GuiSeverity::toString(severity) +"\n";
|
str += GuiSeverity::toString(severity) +"\n";
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
QString file;
|
QString file;
|
||||||
QStringList files;
|
QStringList files;
|
||||||
QList<unsigned int> lines;
|
QList<unsigned int> lines;
|
||||||
QString id;
|
QString errorId;
|
||||||
Severity::SeverityType severity;
|
Severity::SeverityType severity;
|
||||||
bool inconclusive;
|
bool inconclusive;
|
||||||
QString summary;
|
QString summary;
|
||||||
|
@ -128,7 +128,7 @@ class ErrorLine
|
||||||
public:
|
public:
|
||||||
QString file;
|
QString file;
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
QString id;
|
QString errorId;
|
||||||
bool inconclusive;
|
bool inconclusive;
|
||||||
Severity::SeverityType severity;
|
Severity::SeverityType severity;
|
||||||
QString summary;
|
QString summary;
|
||||||
|
|
|
@ -117,7 +117,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
if (!item.summary.contains(mFilter, Qt::CaseInsensitive) &&
|
if (!item.summary.contains(mFilter, Qt::CaseInsensitive) &&
|
||||||
!item.message.contains(mFilter, Qt::CaseInsensitive) &&
|
!item.message.contains(mFilter, Qt::CaseInsensitive) &&
|
||||||
!item.file.contains(mFilter, Qt::CaseInsensitive) &&
|
!item.file.contains(mFilter, Qt::CaseInsensitive) &&
|
||||||
!item.id.contains(mFilter, Qt::CaseInsensitive))
|
!item.errorId.contains(mFilter, Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
hide = true;
|
hide = true;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
|
|
||||||
ErrorLine line;
|
ErrorLine line;
|
||||||
line.file = realfile;
|
line.file = realfile;
|
||||||
line.id = item.id;
|
line.errorId = item.errorId;
|
||||||
line.inconclusive = item.inconclusive;
|
line.inconclusive = item.inconclusive;
|
||||||
line.line = item.lines[0];
|
line.line = item.lines[0];
|
||||||
line.summary = item.summary;
|
line.summary = item.summary;
|
||||||
|
@ -155,7 +155,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
data["message"] = item.message;
|
data["message"] = item.message;
|
||||||
data["file"] = item.files[0];
|
data["file"] = item.files[0];
|
||||||
data["line"] = item.lines[0];
|
data["line"] = item.lines[0];
|
||||||
data["id"] = item.id;
|
data["id"] = item.errorId;
|
||||||
data["inconclusive"] = item.inconclusive;
|
data["inconclusive"] = item.inconclusive;
|
||||||
stditem->setData(QVariant(data));
|
stditem->setData(QVariant(data));
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
child_data["message"] = line.message;
|
child_data["message"] = line.message;
|
||||||
child_data["file"] = item.files[i];
|
child_data["file"] = item.files[i];
|
||||||
child_data["line"] = line.line;
|
child_data["line"] = line.line;
|
||||||
child_data["id"] = line.id;
|
child_data["id"] = line.errorId;
|
||||||
child_data["inconclusive"] = line.inconclusive;
|
child_data["inconclusive"] = line.inconclusive;
|
||||||
child_item->setData(QVariant(child_data));
|
child_item->setData(QVariant(child_data));
|
||||||
}
|
}
|
||||||
|
@ -892,7 +892,7 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
|
||||||
item.severity = ShowTypes::ShowTypeToSeverity(ShowTypes::VariantToShowType(data["severity"]));
|
item.severity = ShowTypes::ShowTypeToSeverity(ShowTypes::VariantToShowType(data["severity"]));
|
||||||
item.summary = data["summary"].toString();
|
item.summary = data["summary"].toString();
|
||||||
item.message = data["message"].toString();
|
item.message = data["message"].toString();
|
||||||
item.id = data["id"].toString();
|
item.errorId = data["id"].toString();
|
||||||
item.inconclusive = data["inconclusive"].toBool();
|
item.inconclusive = data["inconclusive"].toBool();
|
||||||
QString file = StripPath(data["file"].toString(), true);
|
QString file = StripPath(data["file"].toString(), true);
|
||||||
unsigned int line = data["line"].toUInt();
|
unsigned int line = data["line"].toUInt();
|
||||||
|
|
|
@ -34,7 +34,7 @@ void TestXmlReportV1::readXml()
|
||||||
ErrorItem item = errors[0];
|
ErrorItem item = errors[0];
|
||||||
QCOMPARE(item.file, QString("test.cxx"));
|
QCOMPARE(item.file, QString("test.cxx"));
|
||||||
QCOMPARE(item.lines[0], (unsigned int)11);
|
QCOMPARE(item.lines[0], (unsigned int)11);
|
||||||
QCOMPARE(item.id, QString("unreadVariable"));
|
QCOMPARE(item.errorId, QString("unreadVariable"));
|
||||||
QCOMPARE(GuiSeverity::toString(item.severity), QString("style"));
|
QCOMPARE(GuiSeverity::toString(item.severity), QString("style"));
|
||||||
QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used"));
|
QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used"));
|
||||||
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
|
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
|
||||||
|
|
|
@ -37,7 +37,7 @@ void TestXmlReportV2::readXml()
|
||||||
QCOMPARE(item.lines.size(), 1);
|
QCOMPARE(item.lines.size(), 1);
|
||||||
QCOMPARE(item.files[0], QString("test.cxx"));
|
QCOMPARE(item.files[0], QString("test.cxx"));
|
||||||
QCOMPARE(item.lines[0], (unsigned int)11);
|
QCOMPARE(item.lines[0], (unsigned int)11);
|
||||||
QCOMPARE(item.id, QString("unreadVariable"));
|
QCOMPARE(item.errorId, QString("unreadVariable"));
|
||||||
QCOMPARE(GuiSeverity::toString(item.severity), QString("style"));
|
QCOMPARE(GuiSeverity::toString(item.severity), QString("style"));
|
||||||
QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used"));
|
QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used"));
|
||||||
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
|
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
|
||||||
|
@ -50,7 +50,7 @@ void TestXmlReportV2::readXml()
|
||||||
QCOMPARE(item2.lines[0], (unsigned int)32);
|
QCOMPARE(item2.lines[0], (unsigned int)32);
|
||||||
QCOMPARE(item2.files[1], QString("test.cxx"));
|
QCOMPARE(item2.files[1], QString("test.cxx"));
|
||||||
QCOMPARE(item2.lines[1], (unsigned int)16);
|
QCOMPARE(item2.lines[1], (unsigned int)16);
|
||||||
QCOMPARE(item2.id, QString("mismatchAllocDealloc"));
|
QCOMPARE(item2.errorId, QString("mismatchAllocDealloc"));
|
||||||
QCOMPARE(GuiSeverity::toString(item2.severity), QString("error"));
|
QCOMPARE(GuiSeverity::toString(item2.severity), QString("error"));
|
||||||
QCOMPARE(item2.summary, QString("Mismatching allocation and deallocation: k"));
|
QCOMPARE(item2.summary, QString("Mismatching allocation and deallocation: k"));
|
||||||
QCOMPARE(item2.message, QString("Mismatching allocation and deallocation: k"));
|
QCOMPARE(item2.message, QString("Mismatching allocation and deallocation: k"));
|
||||||
|
|
|
@ -76,7 +76,7 @@ void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg)
|
||||||
ErrorItem item;
|
ErrorItem item;
|
||||||
item.file = QString(callStackToString(msg._callStack).c_str());
|
item.file = QString(callStackToString(msg._callStack).c_str());
|
||||||
item.files = files;
|
item.files = files;
|
||||||
item.id = QString(msg._id.c_str());
|
item.errorId = QString(msg._id.c_str());
|
||||||
item.lines = lines;
|
item.lines = lines;
|
||||||
item.summary = QString::fromStdString(msg.shortMessage());
|
item.summary = QString::fromStdString(msg.shortMessage());
|
||||||
item.message = QString::fromStdString(msg.verboseMessage());
|
item.message = QString::fromStdString(msg.verboseMessage());
|
||||||
|
|
|
@ -103,7 +103,7 @@ void XmlReportV1::WriteError(const ErrorItem &error)
|
||||||
mXmlWriter->writeAttribute(FilenameAttribute, file);
|
mXmlWriter->writeAttribute(FilenameAttribute, file);
|
||||||
const QString line = QString::number(error.lines[error.lines.size() - 1]);
|
const QString line = QString::number(error.lines[error.lines.size() - 1]);
|
||||||
mXmlWriter->writeAttribute(LineAttribute, line);
|
mXmlWriter->writeAttribute(LineAttribute, line);
|
||||||
mXmlWriter->writeAttribute(IdAttribute, error.id);
|
mXmlWriter->writeAttribute(IdAttribute, error.errorId);
|
||||||
|
|
||||||
// Don't localize severity so we can read these files
|
// Don't localize severity so we can read these files
|
||||||
mXmlWriter->writeAttribute(SeverityAttribute, GuiSeverity::toString(error.severity));
|
mXmlWriter->writeAttribute(SeverityAttribute, GuiSeverity::toString(error.severity));
|
||||||
|
@ -170,7 +170,7 @@ ErrorItem XmlReportV1::ReadError(QXmlStreamReader *reader)
|
||||||
item.files.push_back(file);
|
item.files.push_back(file);
|
||||||
const int line = attribs.value("", LineAttribute).toString().toUInt();
|
const int line = attribs.value("", LineAttribute).toString().toUInt();
|
||||||
item.lines.push_back(line);
|
item.lines.push_back(line);
|
||||||
item.id = attribs.value("", IdAttribute).toString();
|
item.errorId = attribs.value("", IdAttribute).toString();
|
||||||
item.severity = GuiSeverity::fromString(attribs.value("", SeverityAttribute).toString());
|
item.severity = GuiSeverity::fromString(attribs.value("", SeverityAttribute).toString());
|
||||||
|
|
||||||
// NOTE: This dublicates the message to Summary-field. But since
|
// NOTE: This dublicates the message to Summary-field. But since
|
||||||
|
|
|
@ -113,7 +113,7 @@ void XmlReportV2::WriteError(const ErrorItem &error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mXmlWriter->writeStartElement(ErrorElementName);
|
mXmlWriter->writeStartElement(ErrorElementName);
|
||||||
mXmlWriter->writeAttribute(IdAttribute, error.id);
|
mXmlWriter->writeAttribute(IdAttribute, error.errorId);
|
||||||
|
|
||||||
// Don't localize severity so we can read these files
|
// Don't localize severity so we can read these files
|
||||||
mXmlWriter->writeAttribute(SeverityAttribute, GuiSeverity::toString(error.severity));
|
mXmlWriter->writeAttribute(SeverityAttribute, GuiSeverity::toString(error.severity));
|
||||||
|
@ -201,7 +201,7 @@ ErrorItem XmlReportV2::ReadError(QXmlStreamReader *reader)
|
||||||
if (mXmlReader->name() == ErrorElementName)
|
if (mXmlReader->name() == ErrorElementName)
|
||||||
{
|
{
|
||||||
QXmlStreamAttributes attribs = reader->attributes();
|
QXmlStreamAttributes attribs = reader->attributes();
|
||||||
item.id = attribs.value("", IdAttribute).toString();
|
item.errorId = attribs.value("", IdAttribute).toString();
|
||||||
item.severity = GuiSeverity::fromString(attribs.value("", SeverityAttribute).toString());
|
item.severity = GuiSeverity::fromString(attribs.value("", SeverityAttribute).toString());
|
||||||
const QString summary = attribs.value("", MsgAttribute).toString();
|
const QString summary = attribs.value("", MsgAttribute).toString();
|
||||||
item.summary = XmlReport::unquoteMessage(summary);
|
item.summary = XmlReport::unquoteMessage(summary);
|
||||||
|
|
Loading…
Reference in New Issue