diff options
author | Fabian Kosmale <[email protected]> | 2023-08-29 20:56:35 +0200 |
---|---|---|
committer | Fabian Kosmale <[email protected]> | 2023-08-30 14:18:17 +0200 |
commit | 50f714789d43136ea2f8c29536b6b80d598e3b6f (patch) | |
tree | d5edca63a5e1a5de7848656c6cdadee5cb2b2d94 /src | |
parent | e86a91dfd5535ce548618270343a2521fb0ef4c6 (diff) |
QmlCompiler: Make LoggerCategory private again
It is not needed by the QQmlSA API. Additionally, remove the comparison
operator for LoggerCategory and LoggerId, and replace its users by
getting the id from the category before comparing.
Pick-to: 6.6
Change-Id: I7747b09b941cfd5326b95d2ee2f78b0ee10991d3
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Semih Yavuz <[email protected]>
Reviewed-by: Olivier De Cannière <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/qmlcompiler/qqmljslogger_p.h | 2 | ||||
-rw-r--r-- | src/qmlcompiler/qqmljsloggingutils.h | 36 | ||||
-rw-r--r-- | src/qmlcompiler/qqmljsloggingutils_p.h | 32 |
3 files changed, 33 insertions, 37 deletions
diff --git a/src/qmlcompiler/qqmljslogger_p.h b/src/qmlcompiler/qqmljslogger_p.h index f7ac8fdea4..7d6e9f2900 100644 --- a/src/qmlcompiler/qqmljslogger_p.h +++ b/src/qmlcompiler/qqmljslogger_p.h @@ -18,7 +18,7 @@ #include <private/qtqmlcompilerexports_p.h> #include "qcoloroutput_p.h" -#include "qqmljsloggingutils.h" +#include "qqmljsloggingutils_p.h" #include <private/qqmljsdiagnosticmessage_p.h> diff --git a/src/qmlcompiler/qqmljsloggingutils.h b/src/qmlcompiler/qqmljsloggingutils.h index caca28072c..0c11e03b87 100644 --- a/src/qmlcompiler/qqmljsloggingutils.h +++ b/src/qmlcompiler/qqmljsloggingutils.h @@ -17,7 +17,6 @@ class SourceLocation; } namespace QQmlJS { -class LoggerCategoryPrivate; class Q_QMLCOMPILER_EXPORT LoggerWarningId { @@ -39,41 +38,6 @@ private: const QAnyStringView m_name; }; -class Q_QMLCOMPILER_EXPORT LoggerCategory -{ - Q_DECLARE_PRIVATE(LoggerCategory) - -public: - LoggerCategory(); - LoggerCategory(QString name, QString settingsName, QString description, QtMsgType level, - bool ignored = false, bool isDefault = false); - LoggerCategory(const LoggerCategory &); - LoggerCategory(LoggerCategory &&) noexcept; - LoggerCategory &operator=(const LoggerCategory &); - LoggerCategory &operator=(LoggerCategory &&) noexcept; - ~LoggerCategory(); - - QString name() const; - QString settingsName() const; - QString description() const; - QtMsgType level() const; - bool isIgnored() const; - bool isDefault() const; - - LoggerWarningId id() const; - - void setLevel(QtMsgType); - void setIgnored(bool); - - friend bool operator==(const LoggerCategory &category, const LoggerWarningId &warningId) - { - return category.name() == warningId.name(); - } - -private: - std::unique_ptr<QQmlJS::LoggerCategoryPrivate> d_ptr; -}; - } // namespace QQmlJS extern const Q_QMLCOMPILER_EXPORT QQmlJS::LoggerWarningId qmlRequired; diff --git a/src/qmlcompiler/qqmljsloggingutils_p.h b/src/qmlcompiler/qqmljsloggingutils_p.h index 683836ca6c..f124e6f9a7 100644 --- a/src/qmlcompiler/qqmljsloggingutils_p.h +++ b/src/qmlcompiler/qqmljsloggingutils_p.h @@ -23,6 +23,38 @@ QT_BEGIN_NAMESPACE namespace QQmlJS { +class LoggerCategoryPrivate; + +class Q_QMLCOMPILER_EXPORT LoggerCategory +{ + Q_DECLARE_PRIVATE(LoggerCategory) + +public: + LoggerCategory(); + LoggerCategory(QString name, QString settingsName, QString description, QtMsgType level, + bool ignored = false, bool isDefault = false); + LoggerCategory(const LoggerCategory &); + LoggerCategory(LoggerCategory &&) noexcept; + LoggerCategory &operator=(const LoggerCategory &); + LoggerCategory &operator=(LoggerCategory &&) noexcept; + ~LoggerCategory(); + + QString name() const; + QString settingsName() const; + QString description() const; + QtMsgType level() const; + bool isIgnored() const; + bool isDefault() const; + + LoggerWarningId id() const; + + void setLevel(QtMsgType); + void setIgnored(bool); + +private: + std::unique_ptr<QQmlJS::LoggerCategoryPrivate> d_ptr; +}; + class LoggerCategoryPrivate { friend class QT_PREPEND_NAMESPACE(QQmlJS::LoggerCategory); |