diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-21 16:40:53 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-21 16:40:53 +0900 |
commit | 6fe34a3fc474c298a2df160343b9b3f09caffac2 (patch) | |
tree | b12cb80f3067e431188e62171bd7faf32146b50d /connectiondata.cpp | |
parent | afbbb6b296e43d7e63c568d326cf8732396da387 (diff) | |
download | libquotient-6fe34a3fc474c298a2df160343b9b3f09caffac2.tar.gz libquotient-6fe34a3fc474c298a2df160343b9b3f09caffac2.zip |
Workaround Qt's poor bearer management
Closes #109
Diffstat (limited to 'connectiondata.cpp')
-rw-r--r-- | connectiondata.cpp | 9 |
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 |