diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-07 00:10:11 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-14 20:21:06 +0200 |
commit | 0bd21a8111f3ec3a515f4c9d1587e6770f229275 (patch) | |
tree | 72ea05b06b988d87634287ef71e3e0c8b94da616 /src/corelib/global/qlogging.cpp | |
parent | 11b5825fa08f386d3475fa181d8d3b8738e9cd12 (diff) |
QtCore: use new qEnvironmentVariableIs{Set,Empty}()
In particular, qEmergencyOut() is now completely exception-free.
Incidentally, this patch shows that Qt isn't consistent in how it
treats empty environment variables used as flags, but that is something
for a separate commit. This patch aims to be behaviour-preserving,
except in exceptional circumstances, of course.
Change-Id: Ie106e7b430e1ab086c40c81cc1e56cd0e5400cb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 527021381a..fb17496009 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -126,7 +126,7 @@ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) Q_DECL if (msgType == QtFatalMsg || (msgType == QtWarningMsg - && (!qgetenv("QT_FATAL_WARNINGS").isNull())) ) { + && qEnvironmentVariableIsSet("QT_FATAL_WARNINGS"))) { #if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) // get the current report mode int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW); @@ -679,7 +679,7 @@ void qt_message_output(QtMsgType msgType, const QMessageLogContext &context, con if (msgType == QtFatalMsg || (msgType == QtWarningMsg - && (!qgetenv("QT_FATAL_WARNINGS").isNull())) ) { + && qEnvironmentVariableIsSet("QT_FATAL_WARNINGS")) ) { #if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) // get the current report mode |