GUI: Fix line numbers and filenames in errors.

When converting to use new ErrorItem and ErrorLine I made few mistakes
in how I handled the data. And for some reason there was not even
warnings about converting integers to QStrings.
This commit is contained in:
Kimmo Varis 2010-07-11 01:07:40 +03:00
parent 352941f5df
commit 9a5166075f
1 changed files with 8 additions and 8 deletions

View File

@ -93,7 +93,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
ErrorLine line; ErrorLine line;
line.file = realfile; line.file = realfile;
line.id = item.id; line.id = item.id;
line.line = item.lines[0]; line.line = QString::number(item.lines[0]);
line.msg = item.msg; line.msg = item.msg;
line.severity = item.severity; line.severity = item.severity;
//Create the base item for the error and ensure it has a proper //Create the base item for the error and ensure it has a proper
@ -108,17 +108,17 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
//Add user data to that item //Add user data to that item
QMap<QString, QVariant> data; QMap<QString, QVariant> data;
data["severity"] = SeverityToShowType(line.severity); data["severity"] = SeverityToShowType(item.severity);
data["message"] = line.msg; data["message"] = item.msg;
data["file"] = line.file; data["file"] = item.files[0];
data["line"] = line.line; data["line"] = QString::number(item.lines[0]);
data["id"] = line.id; data["id"] = item.id;
stditem->setData(QVariant(data)); stditem->setData(QVariant(data));
//Add backtrace files as children //Add backtrace files as children
for (int i = 1; i < item.files.size() && i < item.lines.size(); i++) for (int i = 1; i < item.files.size() && i < item.lines.size(); i++)
{ {
line.file = item.files[i]; line.file = StripPath(item.files[i], false);
line.line = item.lines[i]; line.line = item.lines[i];
QStandardItem *child_item; QStandardItem *child_item;
child_item = AddBacktraceFiles(stditem, child_item = AddBacktraceFiles(stditem,
@ -130,7 +130,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
QMap<QString, QVariant> child_data; QMap<QString, QVariant> child_data;
child_data["severity"] = SeverityToShowType(line.severity); child_data["severity"] = SeverityToShowType(line.severity);
child_data["message"] = line.msg; child_data["message"] = line.msg;
child_data["file"] = line.file; 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.id;
child_item->setData(QVariant(child_data)); child_item->setData(QVariant(child_data));