Marble

DownloadPolicy.cpp
1// SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <jmho@c-xx.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#include "DownloadPolicy.h"
6
7namespace Marble
8{
9
10DownloadPolicyKey::DownloadPolicyKey()
11 : m_hostNames()
12 , m_usage(DownloadBrowse)
13{
14}
15
16DownloadPolicyKey::DownloadPolicyKey(const QStringList &hostNames, const DownloadUsage usage)
17 : m_hostNames(hostNames)
18 , m_usage(usage)
19{
20}
21
22DownloadPolicyKey::DownloadPolicyKey(const QString &hostName, const DownloadUsage usage)
23 : m_hostNames(hostName)
24 , m_usage(usage)
25{
26}
27
28QStringList DownloadPolicyKey::hostNames() const
29{
30 return m_hostNames;
31}
32
33void DownloadPolicyKey::setHostNames(const QStringList &hostNames)
34{
35 m_hostNames = hostNames;
36}
37
38DownloadUsage DownloadPolicyKey::usage() const
39{
40 return m_usage;
41}
42
43void DownloadPolicyKey::setUsage(DownloadUsage const usage)
44{
45 m_usage = usage;
46}
47
48bool DownloadPolicyKey::matches(QString const &hostName, const DownloadUsage usage) const
49{
50 return m_hostNames.contains(hostName) && m_usage == usage;
51}
52
53DownloadPolicy::DownloadPolicy()
54 : m_key()
55 , m_maximumConnections(1)
56{
57}
58
59DownloadPolicy::DownloadPolicy(const DownloadPolicyKey &key)
60 : m_key(key)
61 , m_maximumConnections(1)
62{
63}
64
65int DownloadPolicy::maximumConnections() const
66{
67 return m_maximumConnections;
68}
69
70void DownloadPolicy::setMaximumConnections(const int n)
71{
72 m_maximumConnections = n;
73}
74
75DownloadPolicyKey DownloadPolicy::key() const
76{
77 return m_key;
78}
79
80}
Binds a QML item to a specific geodetic location in screen coordinates.
@ DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.