GUI: Fix sinceDate handling

This commit is contained in:
Daniel Marjamäki 2017-08-03 23:27:18 +02:00
parent abce74ff56
commit 7468b40a5e
1 changed files with 5 additions and 1 deletions

View File

@ -1108,7 +1108,11 @@ void ResultsTree::updateFromOldReport(const QString &filename)
QVariantMap data = error->data().toMap();
// New error .. set the "sinceDate" property
if (oldErrorIndex < 0 || data["sinceDate"].toString().isEmpty()) {
if (oldErrorIndex >= 0 && !oldErrors[oldErrorIndex].sinceDate.isEmpty()) {
data["sinceDate"] = oldErrors[oldErrorIndex].sinceDate;
error->setData(data);
fileItem->child(j, COLUMN_SINCE_DATE)->setText(oldErrors[oldErrorIndex].sinceDate);
} else if (oldErrorIndex < 0 || data["sinceDate"].toString().isEmpty()) {
const QString sinceDate = QDate::currentDate().toString(Qt::SystemLocaleShortDate);
data["sinceDate"] = sinceDate;
error->setData(data);