summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-13 10:28:27 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-13 19:41:01 +0100
commit0c6be6e5e9acd6f0597a2fcfaf5af9d93975435b (patch)
tree9e163abe9498a06a474c92ea7a3c11a1b7ad0437 /src/gui/serverdialog.h
parent6efb37c888edec3bb6e37dbf41c54e940441bbea (diff)
downloadmana-0c6be6e5e9acd6f0597a2fcfaf5af9d93975435b.tar.gz
mana-0c6be6e5e9acd6f0597a2fcfaf5af9d93975435b.tar.bz2
mana-0c6be6e5e9acd6f0597a2fcfaf5af9d93975435b.tar.xz
mana-0c6be6e5e9acd6f0597a2fcfaf5af9d93975435b.zip
Make removing a server effective even when quitting afterwards
The custom server list was only saved when connecting to a server. Instead, removing a server from the list should be effective regardless of what is done afterwards. Reviewed-by: peavey
Diffstat (limited to 'src/gui/serverdialog.h')
-rw-r--r--src/gui/serverdialog.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h
index 3d7dca9d..673ee97c 100644
--- a/src/gui/serverdialog.h
+++ b/src/gui/serverdialog.h
@@ -66,15 +66,9 @@ class ServersListModel : public gcn::ListModel
/**
* Used to get the corresponding Server struct
*/
- ServerInfo getServer(int elementIndex) const
+ const ServerInfo &getServer(int elementIndex) const
{ return mServers->at(elementIndex); }
- /**
- * Removes the entry.
- */
- void remove(int elementIndex)
- { mServers->erase(mServers->begin() + elementIndex); }
-
private:
ServerInfos *mServers;
ServerDialog *mParent;
@@ -149,6 +143,10 @@ class ServerDialog : public Window,
*/
void downloadServerList();
void loadServers();
+
+ void loadCustomServers();
+ void saveCustomServers(const ServerInfo &currentServer = ServerInfo());
+
static int downloadUpdate(void *ptr, DownloadStatus status,
size_t total, size_t remaining);