Show correct origin of Q_ASSERT in Windows dialog
authorKai Koehne <kai.koehne@nokia.com>
Wed, 21 Mar 2012 09:15:01 +0000 (10:15 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 22 Mar 2012 07:51:48 +0000 (08:51 +0100)
Display the actual file and line where the Q_ASSERT statement
was triggered.

Change-Id: I54d72f4c4bd9edee744c0f6e08f31b8e3120f454
Reviewed-by: David Faure <faure@kde.org>
src/corelib/global/qlogging.cpp

index 8cbd452..fedc5eb 100644 (file)
@@ -717,10 +717,10 @@ void qt_message_output(QtMsgType msgType, const QMessageLogContext &context, con
         int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW);
         _CrtSetReportMode(_CRT_ERROR, reportMode);
 #if !defined(Q_OS_WINCE)
-        int ret = _CrtDbgReport(_CRT_ERROR, __FILE__, __LINE__, QT_VERSION_STR, buf);
+        int ret = _CrtDbgReport(_CRT_ERROR, context.file, context.line, QT_VERSION_STR, buf);
 #else
-        int ret = _CrtDbgReportW(_CRT_ERROR, _CRT_WIDE(__FILE__),
-                                 __LINE__, _CRT_WIDE(QT_VERSION_STR),
+        int ret = _CrtDbgReportW(_CRT_ERROR, _CRT_WIDE(context.file),
+                                 context.line, _CRT_WIDE(QT_VERSION_STR),
                                  reinterpret_cast<const wchar_t *> (
                                      QString::fromLatin1(buf).utf16()));
 #endif