summaryrefslogtreecommitdiff
path: root/src/net/serverinfo.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-28 22:22:58 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-28 22:50:36 +0100
commitd3672f21211233c24b47ecd5d5965d3909fdf88f (patch)
treec565cd06349bb88b7a3e8a01d69528abfba51400 /src/net/serverinfo.h
parenta97ff19134537be254115139d3d57b930ce519a8 (diff)
downloadmana-client-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.gz
mana-client-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.bz2
mana-client-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.xz
mana-client-d3672f21211233c24b47ecd5d5965d3909fdf88f.zip
Some code cleanup regarding the server dialog
Reviewed-by: Jared Adams
Diffstat (limited to 'src/net/serverinfo.h')
-rw-r--r--src/net/serverinfo.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index ae06984b..a1e22ce7 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -55,6 +55,11 @@ public:
port = info.port;
}
+ bool isValid() const
+ {
+ return !(hostname.empty() || port == 0 || type == UNKNOWN);
+ }
+
void clear()
{
type = UNKNOWN;
@@ -63,13 +68,13 @@ public:
port = 0;
}
- bool operator==(const ServerInfo &other)
+ bool operator==(const ServerInfo &other) const
{
return (type == other.type && hostname == other.hostname &&
port == other.port);
}
- bool operator!=(const ServerInfo &other)
+ bool operator!=(const ServerInfo &other) const
{
return (type != other.type || hostname != other.hostname ||
port != other.port);