summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.h
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-04-02 13:48:06 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-20 08:37:06 +0200
commitd9a1c2dff85635076ecaee3507427d750846c85c (patch)
tree5c60ddcb7815b6ea1789c84c7972ddda2e0a4e85 /src/corelib/global/qlogging.h
parenta3f90fd44f822ae9d77c9d115934e18a9c7466fd (diff)
Logging: Change arguments of message handler to avoid conversions
Introduce a new QtMessageHandler that takes QString instead of char *: This avoids converting to local8bit , only to convert it back to utf16 for Windows. The old QMessageHandler is kept for a transition period, but will be removed before Qt 5.0. Also fix qEmergencyOut (that is called in OOM situations) to not rely on the default message handler. Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.h')
-rw-r--r--src/corelib/global/qlogging.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index 29313bd582..216b847952 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -151,7 +151,8 @@ private:
# define qWarning QT_NO_QWARNING_MACRO
#endif
-Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context, const char *buf);
+Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context,
+ const QString &message);
Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...);
Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
@@ -160,6 +161,10 @@ Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
typedef void (*QtMsgHandler)(QtMsgType, const char *);
Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler);
+typedef void (*QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &);
+Q_CORE_EXPORT QtMessageHandler qInstallMessageHandler(QtMessageHandler);
+
+// TODO: Remove before Qt5.0 Beta
typedef void (*QMessageHandler)(QtMsgType, const QMessageLogContext &, const char *);
Q_CORE_EXPORT QMessageHandler qInstallMessageHandler(QMessageHandler);