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>
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);
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
eventDispatcher = new QEventDispatcherBlackberry(q);
# else
# if !defined(QT_NO_GLIB)
- if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
+ if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && QEventDispatcherGlib::versionSupported())
eventDispatcher = new QEventDispatcherGlib(q);
else
# endif
QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
: mainContext(context)
{
- if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) {
+ if (qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB")) {
static QBasicMutex mutex;
QMutexLocker locker(&mutex);
if (!g_thread_supported())
bool QMimeBinaryProvider::isValid()
{
#if defined(QT_USE_MMAP)
- if (!qgetenv("QT_NO_MIME_CACHE").isEmpty())
+ if (!qEnvironmentVariableIsEmpty("QT_NO_MIME_CACHE"))
return false;
Q_ASSERT(m_cacheFiles.isEmpty()); // this method is only ever called once
data->eventDispatcher = new QEventDispatcherBlackberry;
#else
#if !defined(QT_NO_GLIB)
- if (qgetenv("QT_NO_GLIB").isEmpty()
- && qgetenv("QT_NO_THREADED_GLIB").isEmpty()
+ if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")
+ && qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB")
&& QEventDispatcherGlib::versionSupported())
data->eventDispatcher = new QEventDispatcherGlib;
else
class QAbstractEventDispatcher *createUnixEventDispatcher()
{
#if !defined(QT_NO_GLIB) && !defined(Q_OS_WIN)
- if (qgetenv("QT_NO_GLIB").isEmpty() && QEventDispatcherGlib::versionSupported())
+ if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && QEventDispatcherGlib::versionSupported())
return new QPAEventDispatcherGlib();
else
#endif