aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-21 16:40:53 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-21 16:40:53 +0900
commit6fe34a3fc474c298a2df160343b9b3f09caffac2 (patch)
treeb12cb80f3067e431188e62171bd7faf32146b50d
parentafbbb6b296e43d7e63c568d326cf8732396da387 (diff)
downloadlibquotient-6fe34a3fc474c298a2df160343b9b3f09caffac2.tar.gz
libquotient-6fe34a3fc474c298a2df160343b9b3f09caffac2.zip
Workaround Qt's poor bearer management
Closes #109
-rw-r--r--connectiondata.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/connectiondata.cpp b/connectiondata.cpp
index 5b6ac71d..a982ed3e 100644
--- a/connectiondata.cpp
+++ b/connectiondata.cpp
@@ -26,7 +26,14 @@ using namespace QMatrixClient;
QNetworkAccessManager* createNam()
{
- return new QNetworkAccessManager();
+ auto nam = new QNetworkAccessManager();
+ // See #109. Once Qt bearer management gets better, this workaround
+ // should become unnecessary.
+ nam->connect(nam, &QNetworkAccessManager::networkAccessibleChanged,
+ nam, [=] {
+ nam->setNetworkAccessible(QNetworkAccessManager::Accessible);
+ });
+ return nam;
}
struct ConnectionData::Private