KTextAddons

translatorengineaccessmanager.cpp
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#include "translatorengineaccessmanager.h"
7
8#include <QNetworkAccessManager>
9
10using namespace TextTranslator;
11TranslatorEngineAccessManager::TranslatorEngineAccessManager(QObject *parent)
12 : QObject(parent)
13 , mNetworkAccessManager(new QNetworkAccessManager(this))
14{
15 mNetworkAccessManager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
16 mNetworkAccessManager->setStrictTransportSecurityEnabled(true);
17 mNetworkAccessManager->enableStrictTransportSecurityStore(true);
18}
19
20TranslatorEngineAccessManager::~TranslatorEngineAccessManager() = default;
21
22TranslatorEngineAccessManager *TranslatorEngineAccessManager::self()
23{
24 static TranslatorEngineAccessManager s_self;
25 return &s_self;
26}
27
28QNetworkAccessManager *TranslatorEngineAccessManager::networkManager() const
29{
30 return mNetworkAccessManager;
31}
32
33#include "moc_translatorengineaccessmanager.cpp"
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.