GUI: Add support for inconclusive errors.
This is the first (and quick) support for the inconclusive errors. We simply add [Inconclusive] to begin of the summary. This is temporary solution until better GUI is implemented. XML v1 won't be supporting inconclusive errors. For XML v2 we need still to decide what to do.
This commit is contained in:
parent
b7e14223b3
commit
f9c97c7b56
|
@ -29,6 +29,7 @@ ErrorItem::ErrorItem(const ErrorItem &item)
|
|||
files = item.files;
|
||||
lines = item.lines;
|
||||
id = item.id;
|
||||
inconclusive = item.inconclusive;
|
||||
severity = item.severity;
|
||||
summary = item.summary;
|
||||
message = item.message;
|
||||
|
@ -40,6 +41,7 @@ ErrorItem::ErrorItem(const ErrorLine &line)
|
|||
files.append(line.file);
|
||||
lines.append(line.line);
|
||||
id = line.id;
|
||||
inconclusive = line.inconclusive;
|
||||
severity = line.severity;
|
||||
summary = line.summary;
|
||||
message = line.message;
|
||||
|
@ -47,7 +49,10 @@ ErrorItem::ErrorItem(const ErrorLine &line)
|
|||
|
||||
QString ErrorItem::ToString() const
|
||||
{
|
||||
QString str = file + " - " + id + " - " + GuiSeverity::toString(severity) +"\n";
|
||||
QString str = file + " - " + id + " - ";
|
||||
if (inconclusive)
|
||||
str += "inconclusive ";
|
||||
str += GuiSeverity::toString(severity) +"\n";
|
||||
str += summary + "\n";
|
||||
str += message + "\n";
|
||||
for (int i = 0; i < files.size(); i++)
|
||||
|
|
|
@ -113,6 +113,7 @@ public:
|
|||
QList<unsigned int> lines;
|
||||
QString id;
|
||||
Severity::SeverityType severity;
|
||||
bool inconclusive;
|
||||
QString summary;
|
||||
QString message;
|
||||
};
|
||||
|
@ -128,6 +129,7 @@ public:
|
|||
QString file;
|
||||
unsigned int line;
|
||||
QString id;
|
||||
bool inconclusive;
|
||||
Severity::SeverityType severity;
|
||||
QString summary;
|
||||
QString message;
|
||||
|
|
|
@ -121,6 +121,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
|||
ErrorLine line;
|
||||
line.file = realfile;
|
||||
line.id = item.id;
|
||||
line.inconclusive = item.inconclusive;
|
||||
line.line = item.lines[0];
|
||||
line.summary = item.summary;
|
||||
line.message = item.message;
|
||||
|
@ -144,6 +145,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
|||
data["file"] = item.files[0];
|
||||
data["line"] = item.lines[0];
|
||||
data["id"] = item.id;
|
||||
data["inconclusive"] = item.inconclusive;
|
||||
stditem->setData(QVariant(data));
|
||||
|
||||
//Add backtrace files as children
|
||||
|
@ -165,6 +167,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
|||
child_data["file"] = item.files[i];
|
||||
child_data["line"] = line.line;
|
||||
child_data["id"] = line.id;
|
||||
child_data["inconclusive"] = line.inconclusive;
|
||||
child_item->setData(QVariant(child_data));
|
||||
}
|
||||
|
||||
|
@ -196,7 +199,14 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
|
|||
list << CreateLineNumberItem(QString("%1").arg(item.line));
|
||||
//TODO message has parameter names so we'll need changes to the core
|
||||
//cppcheck so we can get proper translations
|
||||
list << CreateNormalItem(tr(item.summary.toLatin1()));
|
||||
QString summary;
|
||||
if (item.inconclusive)
|
||||
{
|
||||
summary = tr("[Inconclusive]");
|
||||
summary += " ";
|
||||
}
|
||||
summary += item.summary.toLatin1();
|
||||
list << CreateNormalItem(summary);
|
||||
|
||||
// Check for duplicate rows and don't add them if found
|
||||
for (int i = 0; i < parent->rowCount(); i++)
|
||||
|
@ -774,7 +784,13 @@ void ResultsTree::CopyMessage()
|
|||
|
||||
QVariantMap data = mContextItem->data().toMap();
|
||||
|
||||
QString message = data["message"].toString();
|
||||
QString message;
|
||||
if (data["inconclusive"].toBool())
|
||||
{
|
||||
message = tr("[Inconclusive]");
|
||||
message += " ";
|
||||
}
|
||||
message += data["message"].toString();
|
||||
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
clipboard->setText(message);
|
||||
|
@ -903,6 +919,7 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
|
|||
item.summary = data["summary"].toString();
|
||||
item.message = data["message"].toString();
|
||||
item.id = data["id"].toString();
|
||||
item.inconclusive = data["inconclusive"].toBool();
|
||||
QString file = StripPath(data["file"].toString(), true);
|
||||
unsigned int line = data["line"].toUInt();
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg)
|
|||
item.summary = QString::fromStdString(msg.shortMessage());
|
||||
item.message = QString::fromStdString(msg.verboseMessage());
|
||||
item.severity = msg._severity;
|
||||
item.inconclusive = msg._inconclusive;
|
||||
|
||||
if (msg._severity != Severity::debug)
|
||||
emit Error(item);
|
||||
|
|
|
@ -75,8 +75,13 @@ void TxtReport::WriteError(const ErrorItem &error)
|
|||
line += ": ";
|
||||
}
|
||||
}
|
||||
|
||||
line += QString("(%1) %2").arg(GuiSeverity::toString(error.severity)).arg(error.summary);
|
||||
line += QString("(%1) ").arg(GuiSeverity::toString(error.severity));
|
||||
if (error.inconclusive)
|
||||
{
|
||||
line += tr("inconclusive");
|
||||
line += " ";
|
||||
}
|
||||
line += error.summary;
|
||||
|
||||
mTxtWriter << line << endl;
|
||||
}
|
||||
|
|
|
@ -93,6 +93,10 @@ void XmlReportV1::WriteError(const ErrorItem &error)
|
|||
The callstack seems to be ignored here as well, instead last item of the stack is used
|
||||
*/
|
||||
|
||||
// Don't write inconclusive errors to XML V1
|
||||
if (error.inconclusive)
|
||||
return;
|
||||
|
||||
mXmlWriter->writeStartElement(ErrorElementName);
|
||||
QString file = QDir::toNativeSeparators(error.files[error.files.size() - 1]);
|
||||
file = XmlReport::quoteMessage(file);
|
||||
|
|
|
@ -108,6 +108,10 @@ void XmlReportV2::WriteError(const ErrorItem &error)
|
|||
</error>
|
||||
*/
|
||||
|
||||
// Don't write inconclusive errors to XML V2 until we decide the format
|
||||
if (error.inconclusive)
|
||||
return;
|
||||
|
||||
mXmlWriter->writeStartElement(ErrorElementName);
|
||||
mXmlWriter->writeAttribute(IdAttribute, error.id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue