GUI: load xml => set check path to file path if that seems to match

This commit is contained in:
Daniel Marjamäki 2018-02-20 13:40:10 +01:00
parent b1ae56736d
commit 5236bfd845
1 changed files with 9 additions and 6 deletions

View File

@ -346,18 +346,21 @@ void ResultsView::readErrorsXml(const QString &filename)
}
delete report;
report = NULL;
} else {
QMessageBox msgBox;
msgBox.setText(tr("Failed to read the report."));
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
}
ErrorItem item;
foreach (item, errors) {
mUI.mTree->addErrorItem(item);
}
mUI.mTree->setCheckDirectory(QString());
QString dir;
if (!errors.isEmpty() && !errors[0].errorPath.isEmpty()) {
QString relativePath = QFileInfo(filename).canonicalPath();
if (QFileInfo(relativePath + '/' + errors[0].errorPath[0].file).exists())
dir = relativePath;
}
mUI.mTree->setCheckDirectory(dir);
}
void ResultsView::updateDetails(const QModelIndex &index)