diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-28 22:22:58 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-28 22:50:36 +0100 |
commit | d3672f21211233c24b47ecd5d5965d3909fdf88f (patch) | |
tree | c565cd06349bb88b7a3e8a01d69528abfba51400 /src/net/serverinfo.h | |
parent | a97ff19134537be254115139d3d57b930ce519a8 (diff) | |
download | mana-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.gz mana-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.bz2 mana-d3672f21211233c24b47ecd5d5965d3909fdf88f.tar.xz mana-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.h | 9 |
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); |