diff options
author | Marcel Krems <marcel@sarrazin.local> | 2019-09-15 17:51:21 +0200 |
---|---|---|
committer | Marcel Krems <m.krems@software-vision.eu> | 2020-08-29 16:24:21 +0200 |
commit | ab5e444c8fd754321ef0a6b084248e431e84a7a8 (patch) | |
tree | adb5e99599e48b4a23545d2b00516fcf51ed4b25 /src | |
parent | 2a896becdf500ce7f5db2d059b1445fb05a8c329 (diff) |
Remove remaining traces of deprecated QtMsgHandler
Change-Id: I28aecb444eb9bc9e26e6ff8998904dbf28419f25
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 22 | ||||
-rw-r--r-- | src/tools/uic/qclass_lib_map.h | 1 |
2 files changed, 2 insertions, 21 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 28f3357e1b..0e9dd3b5ee 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1487,11 +1487,8 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con return message; } -static void qDefaultMsgHandler(QtMsgType type, const char *buf); static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf); -// pointer to QtMsgHandler debug handler (without context) -static QBasicAtomicPointer<void (QtMsgType, const char*)> msgHandler = Q_BASIC_ATOMIC_INITIALIZER(nullptr); // pointer to QtMessageHandler debug handler (with context) static QBasicAtomicPointer<void (QtMsgType, const QMessageLogContext &, const QString &)> messageHandler = Q_BASIC_ATOMIC_INITIALIZER(nullptr); @@ -1776,15 +1773,6 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con stderr_message_handler(type, context, message); } -/*! - \internal -*/ -static void qDefaultMsgHandler(QtMsgType type, const char *buf) -{ - QMessageLogContext emptyContext; - qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf)); -} - #if defined(Q_COMPILER_THREAD_LOCAL) static thread_local bool msgHandlerGrabbed = false; @@ -1826,14 +1814,8 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex // itself, e.g. by using Qt API if (grabMessageHandler()) { const auto ungrab = qScopeGuard([]{ ungrabMessageHandler(); }); - auto oldStyle = msgHandler.loadAcquire(); - auto newStye = messageHandler.loadAcquire(); - // prefer new message handler over the old one - if (newStye || !oldStyle) { - (newStye ? newStye : qDefaultMessageHandler)(msgType, context, message); - } else { - (oldStyle ? oldStyle : qDefaultMsgHandler)(msgType, message.toLocal8Bit().constData()); - } + auto msgHandler = messageHandler.loadAcquire(); + (msgHandler ? msgHandler : qDefaultMessageHandler)(msgType, context, message); } else { fprintf(stderr, "%s\n", message.toLocal8Bit().constData()); } diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 915f604158..4bd3051cf2 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -32,7 +32,6 @@ QT_CLASS_LIB(QIntegerForSize, QtCore, qglobal.h) QT_CLASS_LIB(Q_INT64, QtCore, qglobal.h) QT_CLASS_LIB(Q_UINT64, QtCore, qglobal.h) QT_CLASS_LIB(QSysInfo, QtCore, qglobal.h) -QT_CLASS_LIB(QtMsgHandler, QtCore, qglobal.h) QT_CLASS_LIB(QGlobalStatic, QtCore, qglobal.h) QT_CLASS_LIB(QGlobalStatic, QtCore, qglobal.h) QT_CLASS_LIB(QGlobalStaticDeleter, QtCore, qglobal.h) |