From 51cf05c1bde7e10aa8b11c1de07542c37263ff5d Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 23 Jun 2015 07:14:26 +1000 Subject: [PATCH] Add env variable to control bearer backend polling timers. Scanning and updating networks can cause transmission jitters when scanning every 10 seconds. setting QT_BEARER_POLL_TIMEOUT, in milliseconds will set polling timer for those bearer backends that require polling, such as generic and windows. Task-number: QTBUG-46015 Change-Id: I0338cd34ad78488ebef250a0114d17ce190434e8 Reviewed-by: Alex Blasche --- src/network/bearer/qnetworkconfigmanager_p.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index c1e837de7b..8ff6ee828d 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -465,15 +465,18 @@ QList QNetworkConfigurationManagerPrivate::engines() const void QNetworkConfigurationManagerPrivate::startPolling() { QMutexLocker locker(&mutex); - - if(!pollTimer) { + if (!pollTimer) { pollTimer = new QTimer(this); - pollTimer->setInterval(10000); + bool ok; + int interval = qgetenv("QT_BEARER_POLL_TIMEOUT").toInt(&ok); + if (!ok) + interval = 10000;//default 10 seconds + pollTimer->setInterval(interval); pollTimer->setSingleShot(true); connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollEngines())); } - if(pollTimer->isActive()) + if (pollTimer->isActive()) return; foreach (QBearerEngine *engine, sessionEngines) { @@ -482,6 +485,7 @@ void QNetworkConfigurationManagerPrivate::startPolling() break; } } + performAsyncConfigurationUpdate(); } void QNetworkConfigurationManagerPrivate::pollEngines()