1 | /* |
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2018 Ralf Habacker <ralf.habacker@freenet.de> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #include "config.h" |
10 | |
11 | using namespace Attica; |
12 | |
13 | class Q_DECL_HIDDEN Config::Private : public QSharedData |
14 | { |
15 | public: |
16 | QString m_version; |
17 | QString m_website; |
18 | QString m_host; |
19 | QString m_contact; |
20 | bool m_ssl; |
21 | |
22 | Private() |
23 | : m_ssl(false) |
24 | { |
25 | } |
26 | }; |
27 | |
28 | Config::Config() |
29 | : d(new Private) |
30 | { |
31 | } |
32 | |
33 | Config::Config(const Attica::Config &other) |
34 | : d(other.d) |
35 | { |
36 | } |
37 | |
38 | Config &Config::operator=(const Attica::Config &other) |
39 | { |
40 | d = other.d; |
41 | return *this; |
42 | } |
43 | |
44 | Config::~Config() |
45 | { |
46 | } |
47 | |
48 | QString Attica::Config::version() const |
49 | { |
50 | return d->m_version; |
51 | } |
52 | |
53 | QString Config::website() const |
54 | { |
55 | return d->m_website; |
56 | } |
57 | |
58 | QString Config::host() const |
59 | { |
60 | return d->m_host; |
61 | } |
62 | |
63 | QString Config::contact() const |
64 | { |
65 | return d->m_contact; |
66 | } |
67 | |
68 | bool Config::ssl() const |
69 | { |
70 | return d->m_ssl; |
71 | } |
72 | |
73 | bool Config::isValid() const |
74 | { |
75 | return !(d->m_version.isEmpty()); |
76 | } |
77 | |
78 | void Config::setContact(const QString &contact) |
79 | { |
80 | d->m_contact = contact; |
81 | } |
82 | |
83 | void Config::setVersion(const QString &version) |
84 | { |
85 | d->m_version = version; |
86 | } |
87 | |
88 | void Config::setWebsite(const QString &website) |
89 | { |
90 | d->m_website = website; |
91 | } |
92 | |
93 | void Config::setHost(const QString &host) |
94 | { |
95 | d->m_host = host; |
96 | } |
97 | |
98 | void Config::setSsl(bool ssl) |
99 | { |
100 | d->m_ssl = ssl; |
101 | } |
102 | |