From 0883623159506f4118c804b4341cea6051d5f718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 15 Feb 2018 22:37:10 +0100 Subject: [PATCH] GUI: Better handling of 'Hide all with ID' --- gui/resultstree.cpp | 8 ++++++++ gui/resultstree.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 4cfbae7f1..73d8725e0 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -139,6 +139,10 @@ bool ResultsTree::addErrorItem(const ErrorItem &item) bool hide = !mShowSeverities.isShown(item.severity); + // Ids that are temporarily hidden.. + if (mHiddenMessageId.contains(item.errorId)) + hide = true; + //If specified, filter on summary, message, filename, and id if (!hide && !mFilter.isEmpty()) { if (!item.summary.contains(mFilter, Qt::CaseInsensitive) && @@ -190,6 +194,7 @@ bool ResultsTree::addErrorItem(const ErrorItem &item) data["file0"] = stripPath(item.file0, true); data["sinceDate"] = item.sinceDate; data["tags"] = item.tags; + data["hide"] = hide; stditem->setData(QVariant(data)); //Add backtrace files as children @@ -423,6 +428,7 @@ void ResultsTree::filterResults(const QString& filter) void ResultsTree::showHiddenResults() { //Clear the "hide" flag for each item + mHiddenMessageId.clear(); int filecount = mModel.rowCount(); for (int i = 0; i < filecount; i++) { QStandardItem *fileItem = mModel.item(i, 0); @@ -931,6 +937,8 @@ void ResultsTree::hideAllIdResult() QString messageId = data["id"].toString(); + mHiddenMessageId.append(messageId); + // hide all errors with that message Id int filecount = mModel.rowCount(); for (int i = 0; i < filecount; i++) { diff --git a/gui/resultstree.h b/gui/resultstree.h index 3258e5d15..ae11fa8cd 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -545,6 +545,8 @@ private: QStringList mTags; + QStringList mHiddenMessageId; + QItemSelectionModel *mSelectionModel; ThreadHandler *mThread;