Fix regressions
[kphotoalbum.git] / SQLDB / ConnectionParameters.h
blobf702055dfe93d75c435340070201c2769278eab3
1 /*
2 Copyright (C) 2007 Tuomas Suutari <thsuut@utu.fi>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program (see the file COPYING); if not, write to the
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
17 MA 02110-1301 USA.
20 #ifndef SQLDB_CONNECTIONPARAMETERS_H
21 #define SQLDB_CONNECTIONPARAMETERS_H
23 #include <QString>
25 namespace SQLDB
27 /** Parameters needed to connect to database.
29 class ConnectionParameters
31 public:
32 ConnectionParameters():
33 _hostName(),
34 _port(0),
35 _userName(),
36 _password()
40 void setToLocal()
42 _hostName.clear();
45 void setHostName(const QString& hostName)
47 _hostName = hostName;
50 void setPort(int port)
52 _port = port;
55 void setUserName(const QString& userName)
57 _userName = userName;
60 void setPassword(const QString& password)
62 _password = password;
65 bool isLocal() const
67 return _hostName.isEmpty();
70 const QString& hostName() const
72 return _hostName;
75 int port() const
77 return _port;
80 const QString& userName() const
82 return _userName;
85 const QString& password() const
87 return _password;
90 private:
91 QString _hostName;
92 int _port;
93 QString _userName;
94 QString _password;
98 #endif /* SQLDB_CONNECTIONPARAMETERS_H */