Add an option to skip the generic bearer engine

Add an option to skip a generic bearer engine if needed (by testing
environment variable QT_EXCLUDE_GENERIC_BEARER).

Task-number: QTBUG-41866
Change-Id: I1b53ed1d22a7b34de5c6f6d0386ed242b2ca5e00
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov 2015-09-22 09:01:30 +02:00
parent 0829baf902
commit 4f3379655c

View File

@ -43,6 +43,10 @@
#include <QtCore/private/qcoreapplication_p.h>
#include <QtCore/private/qthread_p.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qglobal.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
@ -375,6 +379,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
updating = false;
#ifndef QT_NO_LIBRARY
bool envOK = false;
const int skipGeneric = qgetenv("QT_EXCLUDE_GENERIC_BEARER").toInt(&envOK);
QBearerEngine *generic = 0;
QFactoryLoader *l = loader();
const PluginKeyMap keyMap = l->keyMap();
@ -409,8 +415,10 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
}
}
if (generic)
sessionEngines.append(generic);
if (generic) {
if (!envOK || skipGeneric <= 0)
sessionEngines.append(generic);
}
#endif // QT_NO_LIBRARY
}