diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-10-21 11:25:51 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-10-22 09:03:05 +0200 |
| commit | b30e85db558b3a0b52038bf28c3d01d412673e19 (patch) | |
| tree | d506e3bf64347b9d8285ea704af34f513f2d945e /src/qmlcompiler/qqmljsloggingutils.cpp | |
| parent | 7690e5b8511826341101b1706a835232a56f12fe (diff) | |
Compiler: Clean up LoggerCategoryPrivate
Unfriend LoggerCategory and actually implement accessor functions.
Amends cdd7fe05f676ed1664a156beaf63093237a3beac
Change-Id: Iee580f98d84ec554467cb8ab779a4178c7f745fc
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsloggingutils.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsloggingutils.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/qmlcompiler/qqmljsloggingutils.cpp b/src/qmlcompiler/qqmljsloggingutils.cpp index 73767fe510..06298b303b 100644 --- a/src/qmlcompiler/qqmljsloggingutils.cpp +++ b/src/qmlcompiler/qqmljsloggingutils.cpp @@ -35,16 +35,9 @@ LoggerCategory::LoggerCategory() : d_ptr{ new LoggerCategoryPrivate } { } LoggerCategory::LoggerCategory( const QString &name, const QString &settingsName, const QString &description, QtMsgType level, - bool ignored, bool isDefault) - : d_ptr{ new LoggerCategoryPrivate } + bool isIgnored, bool isDefault) + : d_ptr{ new LoggerCategoryPrivate(name, settingsName, description, level, isIgnored, isDefault) } { - Q_D(LoggerCategory); - d->m_name = name; - d->m_settingsName = settingsName; - d->m_description = description; - d->m_level = level; - d->m_ignored = ignored; - d->m_isDefault = isDefault; } LoggerCategory::LoggerCategory(const LoggerCategory &other) @@ -67,37 +60,37 @@ LoggerCategory::~LoggerCategory() = default; QString LoggerCategory::name() const { Q_D(const LoggerCategory); - return d->m_name; + return d->name(); } QString LoggerCategory::settingsName() const { Q_D(const LoggerCategory); - return d->m_settingsName; + return d->settingsName(); } QString LoggerCategory::description() const { Q_D(const LoggerCategory); - return d->m_description; + return d->description(); } QtMsgType LoggerCategory::level() const { Q_D(const LoggerCategory); - return d->m_level; + return d->level(); } bool LoggerCategory::isIgnored() const { Q_D(const LoggerCategory); - return d->m_ignored; + return d->isIgnored(); } bool LoggerCategory::isDefault() const { Q_D(const LoggerCategory); - return d->m_isDefault; + return d->isDefault(); } LoggerWarningId LoggerCategory::id() const @@ -112,6 +105,14 @@ void LoggerCategory::setLevel(QtMsgType type) d->setLevel(type); } +LoggerCategoryPrivate::LoggerCategoryPrivate(const QString &name, const QString &settingsName, + const QString &description, QtMsgType level, + bool isIgnored, bool isDefault) + : m_name(name), m_settingsName(settingsName), m_description(description), m_level(level) + , m_isIgnored(isIgnored), m_isDefault(isDefault) +{ +} + void LoggerCategoryPrivate::setLevel(QtMsgType type) { if (m_level == type) @@ -129,18 +130,13 @@ void LoggerCategory::setIgnored(bool isIgnored) void LoggerCategoryPrivate::setIgnored(bool isIgnored) { - if (m_ignored == isIgnored) + if (m_isIgnored == isIgnored) return; - m_ignored = isIgnored; + m_isIgnored = isIgnored; m_changed = true; } -bool LoggerCategoryPrivate::hasChanged() const -{ - return m_changed; -} - LoggerCategoryPrivate *LoggerCategoryPrivate::get(LoggerCategory *loggerCategory) { Q_ASSERT(loggerCategory); |
