QLoggingCategory: remove init() and merge with the constructor
Nothing else calls it. Drive-by initialize the two pointers via NSDMI. Pick-to: 6.9 6.8 Change-Id: I8c51cf5126aeb8bd6254fffdd21a37526329bbf3 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
16ef3aaa74
commit
c7ec043e46
@ -172,11 +172,6 @@ Q_GLOBAL_STATIC(QLoggingCategory, qtDefaultCategory, qtDefaultCategoryName)
|
|||||||
QLoggingCategory::QLoggingCategory(const char *category, QtMsgType enableForLevel)
|
QLoggingCategory::QLoggingCategory(const char *category, QtMsgType enableForLevel)
|
||||||
: d(nullptr),
|
: d(nullptr),
|
||||||
name(nullptr)
|
name(nullptr)
|
||||||
{
|
|
||||||
init(category, enableForLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QLoggingCategory::init(const char *category, QtMsgType severityLevel)
|
|
||||||
{
|
{
|
||||||
enabled.storeRelaxed(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true;
|
enabled.storeRelaxed(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true;
|
||||||
|
|
||||||
@ -186,7 +181,7 @@ void QLoggingCategory::init(const char *category, QtMsgType severityLevel)
|
|||||||
name = qtDefaultCategoryName;
|
name = qtDefaultCategoryName;
|
||||||
|
|
||||||
if (QLoggingRegistry *reg = QLoggingRegistry::instance())
|
if (QLoggingRegistry *reg = QLoggingRegistry::instance())
|
||||||
reg->registerCategory(this, severityLevel);
|
reg->registerCategory(this, enableForLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -38,10 +38,8 @@ public:
|
|||||||
static void setFilterRules(const QString &rules);
|
static void setFilterRules(const QString &rules);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(const char *category, QtMsgType severityLevel);
|
Q_DECL_UNUSED_MEMBER void *d = nullptr; // reserved for future use
|
||||||
|
const char *name = nullptr;
|
||||||
Q_DECL_UNUSED_MEMBER void *d; // reserved for future use
|
|
||||||
const char *name;
|
|
||||||
|
|
||||||
struct AtomicBools {
|
struct AtomicBools {
|
||||||
QBasicAtomicInteger<bool> enabledDebug;
|
QBasicAtomicInteger<bool> enabledDebug;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user