5ad47612843f87f0cea18f064e2386c5ae166949
[toast/confclerk.git] / src / app / appsettings.cpp
1 /*
2  * Copyright (C) 2010 Ixonos Plc.
3  *
4  * This file is part of fosdem-schedule.
5  *
6  * fosdem-schedule is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 2 of the License, or (at your option)
9  * any later version.
10  *
11  * fosdem-schedule is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 #include "appsettings.h"
20
21 const QString PROXY_ADDRESS_SETTING ("proxyAddress"); 
22 const QString PROXY_PORT_SETTING ("proxyPort"); 
23 const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection"); 
24
25 QSettings AppSettings::mSettings("Ixonos", "FOSDEM");
26
27 QString AppSettings::proxyAddress()
28 {
29     return mSettings.value(PROXY_ADDRESS_SETTING).toString();
30 }
31
32 quint16 AppSettings::proxyPort()
33 {
34     return mSettings.value(PROXY_PORT_SETTING).toUInt();
35 }
36
37 bool AppSettings::isDirectConnection()
38 {
39     return mSettings.value(PROXY_ISDIRECT_SETTING).toBool();
40 }
41
42 void AppSettings::setProxyAddress(const QString &aAddress)
43 {
44     mSettings.setValue(PROXY_ADDRESS_SETTING, aAddress);
45 }
46
47 void AppSettings::setProxyPort(const quint16 aPort)
48 {
49     mSettings.setValue(PROXY_PORT_SETTING, aPort);
50 }
51
52 void AppSettings::setDirectConnection(bool aDirectConnection)
53 {
54     mSettings.setValue(PROXY_ISDIRECT_SETTING, aDirectConnection);
55 }
56
57 bool AppSettings::contains(const QString &aKey)
58 {
59     return mSettings.contains(aKey);
60 }
61