Added icon
[urpo] / src / urpoconnectionsettings.cpp
1 /**************************************************************************
2
3     URPO
4
5     Unix Remote Printing Operation
6     Copyright (c) Arto Hyvättinen 2010
7
8     This file is part of URPO.
9
10     URPO is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
14
15     URPO is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20
21 **************************************************************************/
22
23 #include "urpoconnectionsettings.h"
24 #include <QSettings>
25
26
27 UrpoConnectionSettings::UrpoConnectionSettings(const QString organization, const QString application)
28 {
29     storePassword_ = false;
30     organization_ = organization;
31     application_ = application;
32 }
33
34 QString UrpoConnectionSettings::getHost() const
35 {
36     return host_;
37 }
38
39 QString UrpoConnectionSettings::getIdentity() const
40 {
41     return identity_;
42 }
43
44 QString UrpoConnectionSettings::getUserid() const
45 {
46     return userid_;
47 }
48
49 void UrpoConnectionSettings::setHost(const QString &host)
50 {
51     host_ = host;
52 }
53
54 void UrpoConnectionSettings::setIdentity(const QString &identity)
55 {
56     identity_ = identity;
57 }
58
59 void UrpoConnectionSettings::setUserid(const QString &userid)
60 {
61     userid_ = userid;
62 }
63
64 void UrpoConnectionSettings::store() const
65 {
66     // Store settings using QSettings
67     QSettings settings(organization_, application_);
68     settings.setValue("host",host_);
69     settings.setValue("userid",userid_);
70     settings.setValue("identity",identity_);
71
72 }
73
74 void UrpoConnectionSettings::load()
75 {
76     // Load settings using QSettings
77     QSettings settings(organization_,application_);
78
79     host_ = settings.value("host").toString();
80     userid_ = settings.value("userid").toString();
81     identity_ = settings.value("identity").toString();
82
83
84 }