From 7987595dcd2bf66abcf843d2c4ff0a2efa892b18 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 8 Oct 2015 11:32:10 -0700 Subject: [PATCH] set the bearer poll timeout for wlan scan in Qt 5.5 --- assignment-client/src/AssignmentClientApp.cpp | 4 ++++ domain-server/src/DomainServer.cpp | 4 ++++ interface/src/Application.cpp | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assignment-client/src/AssignmentClientApp.cpp b/assignment-client/src/AssignmentClientApp.cpp index 3b9f8af868..cddce5de7d 100644 --- a/assignment-client/src/AssignmentClientApp.cpp +++ b/assignment-client/src/AssignmentClientApp.cpp @@ -27,6 +27,10 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : QCoreApplication(argc, argv) { + // to work around the Qt constant wireless scanning, set the env for polling interval very high + const QByteArray EXTREME_BEARER_POLL_TIMEOUT = QString::number(INT_MAX).toLocal8Bit(); + qputenv("QT_BEARER_POLL_TIMEOUT", EXTREME_BEARER_POLL_TIMEOUT); + # ifndef WIN32 setvbuf(stdout, NULL, _IOLBF, 0); # endif diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 48bb9bed62..b5fd9f2b20 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -62,6 +62,10 @@ DomainServer::DomainServer(int argc, char* argv[]) : LogUtils::init(); Setting::init(); + + // to work around the Qt constant wireless scanning, set the env for polling interval very high + const QByteArray EXTREME_BEARER_POLL_TIMEOUT = QString::number(INT_MAX).toLocal8Bit(); + qputenv("QT_BEARER_POLL_TIMEOUT", EXTREME_BEARER_POLL_TIMEOUT); connect(this, &QCoreApplication::aboutToQuit, this, &DomainServer::aboutToQuit); diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c427379f74..e6b158d37e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -364,7 +364,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : thread()->setObjectName("Main Thread"); setInstance(this); - + + // to work around the Qt constant wireless scanning, set the env for polling interval very high + const QByteArray EXTREME_BEARER_POLL_TIMEOUT = QString::number(INT_MAX).toLocal8Bit(); + qputenv("QT_BEARER_POLL_TIMEOUT", EXTREME_BEARER_POLL_TIMEOUT); + _entityClipboard->createRootElement(); _pluginContainer = new PluginContainerProxy();