From 2d99b4ee14537748f2237a3586f5c700960627e8 Mon Sep 17 00:00:00 2001 From: Davide Punzo Date: Thu, 26 Sep 2024 11:49:45 +0200 Subject: [PATCH] BUG: Fix error log filtering in ctkErrorLogWidget --- Libs/Core/ctkErrorLogAbstractModel.cpp | 7 +------ Libs/Core/ctkErrorLogLevel.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Libs/Core/ctkErrorLogAbstractModel.cpp b/Libs/Core/ctkErrorLogAbstractModel.cpp index 98e5d47b64..7db711be2c 100644 --- a/Libs/Core/ctkErrorLogAbstractModel.cpp +++ b/Libs/Core/ctkErrorLogAbstractModel.cpp @@ -371,7 +371,7 @@ void ctkErrorLogAbstractModel::clear() //------------------------------------------------------------------------------ void ctkErrorLogAbstractModel::filterEntry(const ctkErrorLogLevel::LogLevels& logLevel, - bool disableFilter) + bool disableFilter) { Q_D(ctkErrorLogAbstractModel); @@ -382,11 +382,6 @@ void ctkErrorLogAbstractModel::filterEntry(const ctkErrorLogLevel::LogLevels& lo } patterns.removeAll(d->ErrorLogLevel(ctkErrorLogLevel::None)); -// foreach(QString s, patterns) -// { -// std::cout << "pattern:" << qPrintable(s) << std::endl; -// } - QMetaEnum logLevelEnum = d->ErrorLogLevel.metaObject()->enumerator(0); Q_ASSERT(QString("LogLevel").compare(logLevelEnum.name()) == 0); diff --git a/Libs/Core/ctkErrorLogLevel.h b/Libs/Core/ctkErrorLogLevel.h index 4101314fa6..5c9b96c495 100644 --- a/Libs/Core/ctkErrorLogLevel.h +++ b/Libs/Core/ctkErrorLogLevel.h @@ -39,16 +39,16 @@ class CTK_CORE_EXPORT ctkErrorLogLevel : public QObject enum LogLevel { - Unknown = 0, - Status, - Trace, - Debug, - Info, - Warning, - Error, - Critical, - Fatal, - None, + Unknown = 0x1, + Status = 0x2, + Trace = 0x4, + Debug = 0x8, + Info = 0x10, + Warning = 0x20, + Error = 0x40, + Critical = 0x80, + Fatal = 0x100, + None = 0x200, }; Q_DECLARE_FLAGS(LogLevels, LogLevel)