aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljslogger.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2025-11-04 15:05:01 +0100
committerOlivier De Cannière <olivier.decanniere@qt.io>2025-11-05 13:43:52 +0100
commita7010824ae029e69564bc4a124f4d4ef2ce37198 (patch)
tree82256d4d91609ba793cf8148a62ab7cf24802dc3 /src/qmlcompiler/qqmljslogger.cpp
parente850ee089b2d92b3b29dd59212f74c9da84d91f0 (diff)
Compiler: Rename QMLLINT_DEFAULT_CATEGORIES to BUILTIN in stead DEFAULT
This helps avoid confusion with the default field for categories. Change-Id: Iceb9a2adeb928a0f801fab9c718a8ecc3ac8cd07 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljslogger.cpp')
-rw-r--r--src/qmlcompiler/qqmljslogger.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qmlcompiler/qqmljslogger.cpp b/src/qmlcompiler/qqmljslogger.cpp
index 15b9d7eb76..8c954c80e9 100644
--- a/src/qmlcompiler/qqmljslogger.cpp
+++ b/src/qmlcompiler/qqmljslogger.cpp
@@ -26,7 +26,7 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// don't forget to forward-declare your logging category ID in qqmljsloggingutils.h!
-#define QMLLINT_DEFAULT_CATEGORIES \
+#define QMLLINT_BUILTIN_CATEGORIES \
X(qmlAccessSingleton, "access-singleton-via-object", "AccessSingletonViaObject", \
"Warn if a singleton is accessed via an object", QtWarningMsg, false, false) \
X(qmlAliasCycle, "alias-cycle", "AliasCycle", "Warn about alias cycles", QtWarningMsg, false, \
@@ -162,12 +162,12 @@ using namespace Qt::StringLiterals;
#define X(category, name, setting, description, level, ignored, isDefault) \
const QQmlSA::LoggerWarningId category{ name };
-QMLLINT_DEFAULT_CATEGORIES
+QMLLINT_BUILTIN_CATEGORIES
#undef X
#define X(category, name, setting, description, level, ignored, isDefault) ++i;
-constexpr size_t numCategories = [] { size_t i = 0; QMLLINT_DEFAULT_CATEGORIES return i; }();
+constexpr size_t numCategories = [] { size_t i = 0; QMLLINT_BUILTIN_CATEGORIES return i; }();
#undef X
constexpr bool isUnique(const std::array<std::string_view, numCategories>& fields) {
@@ -182,21 +182,21 @@ constexpr bool isUnique(const std::array<std::string_view, numCategories>& field
}
#define X(category, name, setting, description, level, ignored, isDefault) std::string_view(name),
-static_assert(isUnique(std::array{ QMLLINT_DEFAULT_CATEGORIES }), "Duplicate names found!");
+static_assert(isUnique(std::array{ QMLLINT_BUILTIN_CATEGORIES }), "Duplicate names found!");
#undef X
#define X(category, name, setting, description, level, ignored, isDefault) std::string_view(setting),
-static_assert(isUnique(std::array{ QMLLINT_DEFAULT_CATEGORIES }), "Duplicate settings found!");
+static_assert(isUnique(std::array{ QMLLINT_BUILTIN_CATEGORIES }), "Duplicate settings found!");
#undef X
#define X(category, name, setting, description, level, ignored, isDefault) std::string_view(description),
-static_assert(isUnique(std::array{ QMLLINT_DEFAULT_CATEGORIES }), "Duplicate description found!");
+static_assert(isUnique(std::array{ QMLLINT_BUILTIN_CATEGORIES }), "Duplicate description found!");
#undef X
QQmlJSLogger::QQmlJSLogger()
{
- static const QList<QQmlJS::LoggerCategory> cats = defaultCategories();
+ static const QList<QQmlJS::LoggerCategory> cats = builtinCategories();
for (const QQmlJS::LoggerCategory &category : cats)
registerCategory(category);
@@ -208,12 +208,12 @@ QQmlJSLogger::QQmlJSLogger()
m_output.insertMapping(QtDebugMsg, QColorOutput::GreenForeground); // None?
}
-const QList<QQmlJS::LoggerCategory> &QQmlJSLogger::defaultCategories()
+const QList<QQmlJS::LoggerCategory> &QQmlJSLogger::builtinCategories()
{
static const QList<QQmlJS::LoggerCategory> cats = {
#define X(category, name, setting, description, level, ignored, isDefault) \
QQmlJS::LoggerCategory{ name##_L1, setting##_L1, description##_L1, level, ignored, isDefault },
- QMLLINT_DEFAULT_CATEGORIES
+ QMLLINT_BUILTIN_CATEGORIES
#undef X
};