diff --git a/gui/erroritem.cpp b/gui/erroritem.cpp index 8ba84d330..815ccd921 100644 --- a/gui/erroritem.cpp +++ b/gui/erroritem.cpp @@ -79,3 +79,14 @@ QString ErrorItem::ToString() const } return str; } + +bool ErrorItem::sameCID(const ErrorItem &errorItem1, const ErrorItem &errorItem2) +{ + // TODO: Implement some better CID calculation + return errorItem1.errorId == errorItem2.errorId && + errorItem1.errorPath == errorItem2.errorPath && + errorItem1.file0 == errorItem2.file0 && + errorItem1.message == errorItem2.message && + errorItem1.inconclusive == errorItem2.inconclusive && + errorItem1.severity == errorItem2.severity; +} diff --git a/gui/erroritem.h b/gui/erroritem.h index dafa23724..11056e642 100644 --- a/gui/erroritem.h +++ b/gui/erroritem.h @@ -94,6 +94,11 @@ public: // Special GUI properties QString sinceDate; QString tags; + + /** + * Compare "CID" + */ + static bool sameCID(const ErrorItem &errorItem1, const ErrorItem &errorItem2); }; Q_DECLARE_METATYPE(ErrorItem); diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index f1943129b..d3fbfa15b 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -1131,12 +1131,7 @@ void ResultsTree::saveErrors(Report *report, QStandardItem *fileItem) const static int indexOf(const QList &list, const ErrorItem &item) { for (int i = 0; i < list.size(); i++) { - if (list[i].errorId == item.errorId && - list[i].errorPath == item.errorPath && - list[i].file0 == item.file0 && - list[i].message == item.message && - list[i].inconclusive == item.inconclusive && - list[i].severity == item.severity) { + if (ErrorItem::sameCID(item, list[i])) { return i; } }