From 55e37d20e1c8b6fecef5d4b52b8fce3a884bd0be Mon Sep 17 00:00:00 2001 From: Andreas Habel Date: Wed, 7 Oct 2009 20:13:32 +0200 Subject: Added sorting to online serverlist by last usage and merge of local and remotely listed servers. --- src/gui/serverdialog.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/gui/serverdialog.h') diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index e6e366b7..62275e6a 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -64,11 +64,27 @@ class ServersListModel : public gcn::ListModel */ void addElement(ServerInfo server); + /** + * Add an Element at the end of the server list if it + * doesn't exist yet. Otherwise overwrite its properties + * in the list. + * + * @param server ServerInfo to merge into the list. + */ + void mergeElement(ServerInfo server); + /** * Add an Element at the beginning of the server list */ void addFirstElement(ServerInfo server); + /** + * Returns wheter the given server is already in the list. + * @param server Server to search in the list. + * @return True, if the server is in the list, false otherwise. + */ + bool contains(ServerInfo server); + private: std::vector servers; }; @@ -106,6 +122,9 @@ class ServerDialog : public Window, void valueChanged(const gcn::SelectionEvent &event); private: + /** + * Called to load a list of available server from an online xml file. + */ void loadServerlist(); gcn::TextField *mServerNameField; -- cgit v1.2.3-70-g09d2