KOSMIndoorMap

networkaccessmanagerfactory.cpp
1/*
2 SPDX-FileCopyrightText: 2024 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#include "networkaccessmanagerfactory.h"
7
8#include <QCoreApplication>
9#include <QNetworkAccessManager>
10#include <QNetworkDiskCache>
11#include <QStandardPaths>
12
13using namespace Qt::StringLiterals;
14
16{
17 static QNetworkAccessManager *s_nam = nullptr;
18
19 if (!s_nam) {
22
25
26 auto namDiskCache = new QNetworkDiskCache(s_nam);
27 namDiskCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/nam/"));
28 s_nam->setCache(namDiskCache);
29 }
30
31 return s_nam;
32}
KOSMINDOORMAP_EXPORT QNetworkAccessManager * defaultNetworkAccessManagerFactory()
Default implementation if not using an application-specific QNetworkAccessManager instance.
QCoreApplication * instance()
void enableStrictTransportSecurityStore(bool enabled, const QString &storeDir)
void setCache(QAbstractNetworkCache *cache)
void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy)
void setStrictTransportSecurityEnabled(bool enabled)
QString writableLocation(StandardLocation type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.