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,
17 const DownloadUsage usage )
18 : m_hostNames( hostNames ),
19 m_usage( usage )
20{
21}
22
23DownloadPolicyKey::DownloadPolicyKey( const QString & hostName,
24 const DownloadUsage usage )
25 : m_hostNames( hostName ),
26 m_usage( usage )
27{
28}
29
30QStringList DownloadPolicyKey::hostNames() const
31{
32 return m_hostNames;
33}
34
35void DownloadPolicyKey::setHostNames( const QStringList & hostNames )
36{
37 m_hostNames = hostNames;
38}
39
40DownloadUsage DownloadPolicyKey::usage() const
41{
42 return m_usage;
43}
44
45void DownloadPolicyKey::setUsage( DownloadUsage const usage )
46{
47 m_usage = usage;
48}
49
50bool DownloadPolicyKey::matches( QString const & hostName, const DownloadUsage usage ) const
51{
52 return m_hostNames.contains( hostName ) && m_usage == usage;
53}
54
55
56DownloadPolicy::DownloadPolicy()
57 : m_key(),
58 m_maximumConnections( 1 )
59{
60}
61
62DownloadPolicy::DownloadPolicy( const DownloadPolicyKey & key )
63 : m_key( key ),
64 m_maximumConnections( 1 )
65{
66}
67
68int DownloadPolicy::maximumConnections() const
69{
70 return m_maximumConnections;
71}
72
73void DownloadPolicy::setMaximumConnections( const int n )
74{
75 m_maximumConnections = n;
76}
77
78DownloadPolicyKey DownloadPolicy::key() const
79{
80 return m_key;
81}
82
83}
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 Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.