diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-20 19:28:56 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-11-20 19:28:56 +0900 |
commit | afbbb6b296e43d7e63c568d326cf8732396da387 (patch) | |
tree | f25df88050084710c72fe561678fe935aecfb073 | |
parent | d8a5a5fb25f3b00fd52a707a8d0e3655cd63a4fe (diff) | |
download | libquotient-afbbb6b296e43d7e63c568d326cf8732396da387.tar.gz libquotient-afbbb6b296e43d7e63c568d326cf8732396da387.zip |
Slightly rearrange code so that the NAM singleton could be configured easier
-rw-r--r-- | connectiondata.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/connectiondata.cpp b/connectiondata.cpp index 6ef293cd..5b6ac71d 100644 --- a/connectiondata.cpp +++ b/connectiondata.cpp @@ -24,10 +24,9 @@ using namespace QMatrixClient; -QNetworkAccessManager* getNam() +QNetworkAccessManager* createNam() { - static QNetworkAccessManager* _nam = new QNetworkAccessManager(); - return _nam; + return new QNetworkAccessManager(); } struct ConnectionData::Private @@ -64,7 +63,8 @@ QUrl ConnectionData::baseUrl() const QNetworkAccessManager* ConnectionData::nam() const { - return getNam(); + static auto nam = createNam(); + return nam; } void ConnectionData::setToken(QByteArray token) |