From ae7fc7fe3e9a0f8784d9db4e1b430327e8006c6d Mon Sep 17 00:00:00 2001 From: Vesa Pikki Date: Sat, 23 May 2009 11:33:38 +0300 Subject: [PATCH] When adding a new error, only hides it and doesn't check all errors. --- gui/resultstree.cpp | 28 +++++++++++++++------------- gui/resultstree.h | 3 ++- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index a7b600bf1..cca631c82 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -68,14 +68,15 @@ void ResultsTree::AddErrorItem(const QString &file, realfile = "Undefined file"; } - + bool hide = !mShowTypes[SeverityToShowType(severity)]; //Create the base item for the error and ensure it has a proper //file item as a parent QStandardItem *item = AddBacktraceFiles(EnsureFileItem(realfile), realfile, lines[0].toInt(), severity, - message); + message, + hide); //Add user data to that item @@ -89,21 +90,27 @@ void ResultsTree::AddErrorItem(const QString &file, //Add backtrace files as children for (int i=1;i list; list << CreateItem(file); @@ -112,16 +119,11 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent, list << CreateItem(message); + QModelIndex index = QModelIndex(); - if (parent) - { - parent->appendRow(list); + parent->appendRow(list); - } - else - { - mModel.appendRow(list); - } + setRowHidden(parent->rowCount()-1,parent->index(),hide); //TODO Does this leak memory? Should items from list be deleted? diff --git a/gui/resultstree.h b/gui/resultstree.h index 508e3933a..d3fd892fc 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -63,7 +63,8 @@ protected: const QString &file, const int line, const QString &severity, - const QString &message); + const QString &message, + const bool hide); void AddItem(int index); void RefreshTree();