-
Notifications
You must be signed in to change notification settings - Fork 9
/
loginserver.h
60 lines (44 loc) · 958 Bytes
/
loginserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef LOGINSERVER_H
#define LOGINSERVER_H
#include <QListWidgetItem>
class LoginServer : public QListWidgetItem {
protected:
QString host;
unsigned short port;
public:
LoginServer(const LoginServer& s) : QListWidgetItem(s) {
initialize(s);
}
LoginServer(const QString& name, const QString& host, unsigned short port) {
this->host = host;
this->port = port;
setText(name);
}
LoginServer& operator=(const LoginServer& s) {
if (this == &s)
return *this;
initialize(s);
return *this;
}
void initialize(const LoginServer& s) {
host = s.host;
port = s.port;
setText(s.text());
}
void setHost(const QString& host) {
this->host = host;
}
void setPort(unsigned short port) {
this->port = port;
}
QString getHost() {
return host;
}
QString getName() {
return text();
}
unsigned short getPort() {
return port;
}
};
#endif // LOGINSERVER_H