GUI: Use integer list instead of variant list for line numbers.
This commit is contained in:
parent
2f0202d105
commit
faa483b8d0
|
@ -33,7 +33,7 @@ class ErrorItem
|
||||||
public:
|
public:
|
||||||
QString file;
|
QString file;
|
||||||
QStringList files;
|
QStringList files;
|
||||||
QStringList lines;
|
QList<unsigned int> lines;
|
||||||
QString id;
|
QString id;
|
||||||
QString severity;
|
QString severity;
|
||||||
QString msg;
|
QString msg;
|
||||||
|
|
|
@ -617,7 +617,7 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
|
||||||
item.msg = data["message"].toString();
|
item.msg = data["message"].toString();
|
||||||
item.id = data["id"].toString();
|
item.id = data["id"].toString();
|
||||||
QString file = StripPath(data["file"].toString(), true);
|
QString file = StripPath(data["file"].toString(), true);
|
||||||
QString line = data["line"].toString();
|
unsigned int line = data["line"].toUInt();
|
||||||
|
|
||||||
item.files << file;
|
item.files << file;
|
||||||
item.lines << line;
|
item.lines << line;
|
||||||
|
@ -631,7 +631,7 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item)
|
||||||
QVariantMap child_data = child_userdata.toMap();
|
QVariantMap child_data = child_userdata.toMap();
|
||||||
|
|
||||||
file = StripPath(child_data["file"].toString(), true);
|
file = StripPath(child_data["file"].toString(), true);
|
||||||
line = child_data["line"].toString();
|
line = child_data["line"].toUInt();
|
||||||
|
|
||||||
item.files << file;
|
item.files << file;
|
||||||
item.lines << line;
|
item.lines << line;
|
||||||
|
|
|
@ -70,7 +70,7 @@ void ResultsView::Error(const QString &file,
|
||||||
const QString &severity,
|
const QString &severity,
|
||||||
const QString &message,
|
const QString &message,
|
||||||
const QStringList &files,
|
const QStringList &files,
|
||||||
const QVariantList &lines,
|
const QList<unsigned int> &lines,
|
||||||
const QString &id)
|
const QString &id)
|
||||||
{
|
{
|
||||||
mErrorsFound = true;
|
mErrorsFound = true;
|
||||||
|
@ -78,15 +78,10 @@ void ResultsView::Error(const QString &file,
|
||||||
item.file = file;
|
item.file = file;
|
||||||
item.files = files;
|
item.files = files;
|
||||||
item.id = id;
|
item.id = id;
|
||||||
|
item.lines = lines;
|
||||||
item.msg = message;
|
item.msg = message;
|
||||||
item.severity = severity;
|
item.severity = severity;
|
||||||
|
|
||||||
QVariant line;
|
|
||||||
foreach(line, lines)
|
|
||||||
{
|
|
||||||
item.lines.append(line.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
mUI.mTree->AddErrorItem(item);
|
mUI.mTree->AddErrorItem(item);
|
||||||
emit GotResults();
|
emit GotResults();
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ public slots:
|
||||||
const QString &severity,
|
const QString &severity,
|
||||||
const QString &message,
|
const QString &message,
|
||||||
const QStringList &files,
|
const QStringList &files,
|
||||||
const QVariantList &lines,
|
const QList<unsigned int> &lines,
|
||||||
const QString &id);
|
const QString &id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -145,13 +145,13 @@ void ThreadHandler::Initialize(ResultsView *view)
|
||||||
const QString &,
|
const QString &,
|
||||||
const QString &,
|
const QString &,
|
||||||
const QStringList &,
|
const QStringList &,
|
||||||
const QVariantList &,
|
const QList<unsigned int> &,
|
||||||
const QString &)),
|
const QString &)),
|
||||||
view, SLOT(Error(const QString &,
|
view, SLOT(Error(const QString &,
|
||||||
const QString &,
|
const QString &,
|
||||||
const QString &,
|
const QString &,
|
||||||
const QStringList &,
|
const QStringList &,
|
||||||
const QVariantList &,
|
const QList<unsigned int> &,
|
||||||
const QString &)));
|
const QString &)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
QVariantList lines;
|
QList<unsigned int> lines;
|
||||||
QStringList files;
|
QStringList files;
|
||||||
|
|
||||||
for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator tok = msg._callStack.begin();
|
for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator tok = msg._callStack.begin();
|
||||||
|
|
|
@ -98,7 +98,7 @@ signals:
|
||||||
const QString &severity,
|
const QString &severity,
|
||||||
const QString &message,
|
const QString &message,
|
||||||
const QStringList &files,
|
const QStringList &files,
|
||||||
const QVariantList &lines,
|
const QList<unsigned int> &lines,
|
||||||
const QString &id);
|
const QString &id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -88,7 +88,8 @@ void XmlReport::WriteError(const ErrorItem &error)
|
||||||
|
|
||||||
mXmlWriter->writeStartElement(ErrorElementName);
|
mXmlWriter->writeStartElement(ErrorElementName);
|
||||||
mXmlWriter->writeAttribute(FilenameAttribute, error.files[error.files.size() - 1]);
|
mXmlWriter->writeAttribute(FilenameAttribute, error.files[error.files.size() - 1]);
|
||||||
mXmlWriter->writeAttribute(LineAttribute, error.lines[error.lines.size() - 1]);
|
const QString line = QString::number(error.lines[error.lines.size() - 1]);
|
||||||
|
mXmlWriter->writeAttribute(LineAttribute, line);
|
||||||
mXmlWriter->writeAttribute(IdAttribute, error.id);
|
mXmlWriter->writeAttribute(IdAttribute, error.id);
|
||||||
mXmlWriter->writeAttribute(SeverityAttribute, error.severity);
|
mXmlWriter->writeAttribute(SeverityAttribute, error.severity);
|
||||||
mXmlWriter->writeAttribute(MsgAttribute, error.msg);
|
mXmlWriter->writeAttribute(MsgAttribute, error.msg);
|
||||||
|
|
Loading…
Reference in New Issue