summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-22 16:48:31 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-22 16:48:31 +0100
commite8bb36aa192dabb982dcc3c57b2c3c3e827133f0 (patch)
tree2d7c719234535e050f72442537ecc3a68cf7cf01 /src
parent4e01dd6b7c235f273d8b1d9233247c956198f1ab (diff)
Fix edit server button on windows.
Diffstat (limited to 'src')
-rw-r--r--src/wx/config_dialog.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index c5d9be41f..8a430f4f1 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -263,21 +263,14 @@ ConfigDialog::edit_server_clicked (wxCommandEvent &)
_servers->GetItem (item);
vector<ServerDescription*> servers = Config::instance()->servers ();
- vector<ServerDescription*>::iterator j = servers.begin();
- while (j != servers.end() && (*j)->host_name() != wx_to_std (item.GetText ())) {
- ++j;
- }
-
- if (j == servers.end()) {
- return;
- }
+ assert (i >= 0 && i < servers.size ());
- ServerDialog* d = new ServerDialog (this, *j);
+ ServerDialog* d = new ServerDialog (this, servers[i]);
d->ShowModal ();
d->Destroy ();
- _servers->SetItem (i, 0, std_to_wx ((*j)->host_name ()));
- _servers->SetItem (i, 1, std_to_wx (boost::lexical_cast<string> ((*j)->threads ())));
+ _servers->SetItem (i, 0, std_to_wx (servers[i]->host_name ()));
+ _servers->SetItem (i, 1, std_to_wx (boost::lexical_cast<string> (servers[i]->threads ())));
}
void