• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
DownloadPolicy.cpp
Go to the documentation of this file.
1 // Copyright 2009 Jens-Michael Hoffmann <jmho@c-xx.com>
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
15 
16 #include "DownloadPolicy.h"
17 
18 namespace Marble
19 {
20 
21 DownloadPolicyKey::DownloadPolicyKey()
22  : m_hostNames(),
23  m_usage( DownloadBrowse )
24 {
25 }
26 
27 DownloadPolicyKey::DownloadPolicyKey( const QStringList & hostNames,
28  const DownloadUsage usage )
29  : m_hostNames( hostNames ),
30  m_usage( usage )
31 {
32 }
33 
34 DownloadPolicyKey::DownloadPolicyKey( const QString & hostName,
35  const DownloadUsage usage )
36  : m_hostNames( hostName ),
37  m_usage( usage )
38 {
39 }
40 
41 QStringList DownloadPolicyKey::hostNames() const
42 {
43  return m_hostNames;
44 }
45 
46 void DownloadPolicyKey::setHostNames( const QStringList & hostNames )
47 {
48  m_hostNames = hostNames;
49 }
50 
51 DownloadUsage DownloadPolicyKey::usage() const
52 {
53  return m_usage;
54 }
55 
56 void DownloadPolicyKey::setUsage( DownloadUsage const usage )
57 {
58  m_usage = usage;
59 }
60 
61 bool DownloadPolicyKey::matches( QString const & hostName, const DownloadUsage usage ) const
62 {
63  return m_hostNames.contains( hostName ) && m_usage == usage;
64 }
65 
66 
67 DownloadPolicy::DownloadPolicy()
68  : m_key(),
69  m_maximumConnections( 1 )
70 {
71 }
72 
73 DownloadPolicy::DownloadPolicy( const DownloadPolicyKey & key )
74  : m_key( key ),
75  m_maximumConnections( 1 )
76 {
77 }
78 
79 int DownloadPolicy::maximumConnections() const
80 {
81  return m_maximumConnections;
82 }
83 
84 void DownloadPolicy::setMaximumConnections( const int n )
85 {
86  m_maximumConnections = n;
87 }
88 
89 DownloadPolicyKey DownloadPolicy::key() const
90 {
91  return m_key;
92 }
93 
94 }
Marble::DownloadPolicy::setMaximumConnections
void setMaximumConnections(const int)
Definition: DownloadPolicy.cpp:84
Marble::DownloadUsage
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:164
Marble::DownloadPolicyKey
Definition: DownloadPolicy.h:27
QStringList::contains
bool contains(const QString &str, Qt::CaseSensitivity cs) const
Marble::DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
Definition: MarbleGlobal.h:166
Marble::DownloadPolicy::DownloadPolicy
DownloadPolicy()
Definition: DownloadPolicy.cpp:67
DownloadPolicy.h
Marble::DownloadPolicyKey::hostNames
QStringList hostNames() const
Definition: DownloadPolicy.cpp:41
Marble::DownloadPolicy::key
DownloadPolicyKey key() const
Definition: DownloadPolicy.cpp:89
Marble::DownloadPolicy::maximumConnections
int maximumConnections() const
Definition: DownloadPolicy.cpp:79
Marble::DownloadPolicyKey::usage
DownloadUsage usage() const
Definition: DownloadPolicy.cpp:51
QString
Marble::DownloadPolicyKey::matches
bool matches(const QString &hostName, const DownloadUsage usage) const
Definition: DownloadPolicy.cpp:61
QStringList
Marble::DownloadPolicyKey::DownloadPolicyKey
DownloadPolicyKey()
Definition: DownloadPolicy.cpp:21
Marble::DownloadPolicyKey::setUsage
void setUsage(DownloadUsage const usage)
Definition: DownloadPolicy.cpp:56
Marble::DownloadPolicyKey::setHostNames
void setHostNames(const QStringList &hostNames)
Definition: DownloadPolicy.cpp:46
usage
void usage(const QString &app)
Definition: merge_ts_po.cpp:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal