summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-27 12:42:14 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-31 23:38:51 +0100
commit2e70a4a4412f44934b3d2055c5b46c441dd0d132 (patch)
treeadf4e2aa9af2342c9d700bf6e046a3e29b3d39c0 /src
parent3b391ad0b59d0a8a7547134bc3ca744c2f38acee (diff)
downloadmana-2e70a4a4412f44934b3d2055c5b46c441dd0d132.tar.gz
mana-2e70a4a4412f44934b3d2055c5b46c441dd0d132.tar.bz2
mana-2e70a4a4412f44934b3d2055c5b46c441dd0d132.tar.xz
mana-2e70a4a4412f44934b3d2055c5b46c441dd0d132.zip
Fixed saving the selected server at server connection level.
I also change the serverInfo to use a deque to permit the use of the push_front function. Spotted and reviewed-by: Erik Schilling
Diffstat (limited to 'src')
-rw-r--r--src/gui/serverdialog.cpp4
-rw-r--r--src/net/serverinfo.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 6dae9ea9..91e5fdeb 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -298,11 +298,13 @@ void ServerDialog::action(const gcn::ActionEvent &event)
const ServerInfo &serverInfo = mServersListModel->getServer(index);
mServerInfo->hostname = serverInfo.hostname;
+ mServerInfo->name = serverInfo.name;
mServerInfo->port = serverInfo.port;
mServerInfo->type = serverInfo.type;
// Save the selected server
mServerInfo->save = true;
+ saveCustomServers(*mServerInfo);
chatLogger->setServerName(mServerInfo->hostname);
@@ -587,7 +589,7 @@ void ServerDialog::saveCustomServers(const ServerInfo &currentServer, int index)
break;
}
}
- mServers.insert(mServers.begin(), currentServer);
+ mServers.push_front(currentServer);
}
}
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index d60c16e1..0748430f 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -25,7 +25,7 @@
#include "utils/stringutils.h"
#include <string>
-#include <vector>
+#include <deque>
class ServerInfo
{
@@ -111,6 +111,6 @@ public:
}
};
-typedef std::vector<ServerInfo> ServerInfos;
+typedef std::deque<ServerInfo> ServerInfos;
#endif // SERVERINFO_H