File indexing completed on 2025-01-05 03:53:35

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2011-03-22
0007  * Description : a Iface C++ interface
0008  *
0009  * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2011      by Remi Benoit <r3m1 dot benoit at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #include "mediawiki_iface_p.h"
0017 
0018 // Qt includes
0019 
0020 
0021 namespace MediaWiki
0022 {
0023 
0024 Iface::Iface(const QUrl& url, const QString& customUserAgent)
0025     : d(new Private(url,
0026             (customUserAgent.isEmpty() ? QString()
0027                                        : QString(customUserAgent +
0028                                          QStringLiteral("-")))   +
0029                                          Private::POSTFIX_USER_AGENT,
0030             new QNetworkAccessManager()))
0031 {
0032 }
0033 
0034 Iface::~Iface()
0035 {
0036     delete d;
0037 }
0038 
0039 QUrl Iface::url() const
0040 {
0041     return d->url;
0042 }
0043 
0044 QString Iface::userAgent() const
0045 {
0046     return d->userAgent;
0047 }
0048 
0049 QNetworkAccessManager* Iface::manager() const
0050 {
0051     return d->manager;
0052 }
0053 
0054 } // namespace MediaWiki