From afbbb6b296e43d7e63c568d326cf8732396da387 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 20 Nov 2017 19:28:56 +0900 Subject: Slightly rearrange code so that the NAM singleton could be configured easier --- connectiondata.cpp | 8 ++++---- 1 file 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) -- cgit v1.2.3