aboutsummaryrefslogtreecommitdiff
path: root/connectiondata.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-20 19:28:56 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-11-20 19:28:56 +0900
commitafbbb6b296e43d7e63c568d326cf8732396da387 (patch)
treef25df88050084710c72fe561678fe935aecfb073 /connectiondata.cpp
parentd8a5a5fb25f3b00fd52a707a8d0e3655cd63a4fe (diff)
downloadlibquotient-afbbb6b296e43d7e63c568d326cf8732396da387.tar.gz
libquotient-afbbb6b296e43d7e63c568d326cf8732396da387.zip
Slightly rearrange code so that the NAM singleton could be configured easier
Diffstat (limited to 'connectiondata.cpp')
-rw-r--r--connectiondata.cpp8
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)