1 | // SPDX-FileCopyrightText: 2018 Kitsune Ral <kitsune-ral@users.sf.net> |
---|---|
2 | // SPDX-License-Identifier: LGPL-2.1-or-later |
3 | |
4 | #pragma once |
5 | |
6 | #include "Quotient/quotient_export.h" |
7 | |
8 | #include <QtNetwork/QNetworkAccessManager> |
9 | |
10 | namespace Quotient { |
11 | |
12 | class QUOTIENT_API NetworkAccessManager : public QNetworkAccessManager { |
13 | Q_OBJECT |
14 | public: |
15 | using QNetworkAccessManager::QNetworkAccessManager; |
16 | |
17 | static void addBaseUrl(const QString& accountId, const QUrl& homeserver); |
18 | static void dropBaseUrl(const QString& accountId); |
19 | |
20 | static QList<QSslError> ignoredSslErrors(); |
21 | static void addIgnoredSslError(const QSslError& error); |
22 | static void clearIgnoredSslErrors(); |
23 | |
24 | //! Get a NAM instance for the current thread |
25 | static NetworkAccessManager* instance(); |
26 | |
27 | private Q_SLOTS: |
28 | QStringList supportedSchemesImplementation() const; // clazy:exclude=const-signal-or-slot |
29 | |
30 | private: |
31 | QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, |
32 | QIODevice* outgoingData = Q_NULLPTR) override; |
33 | }; |
34 | } // namespace Quotient |
35 |