diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-09-22 16:48:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-09-22 16:48:31 +0100 |
| commit | e8bb36aa192dabb982dcc3c57b2c3c3e827133f0 (patch) | |
| tree | 2d7c719234535e050f72442537ecc3a68cf7cf01 | |
| parent | 4e01dd6b7c235f273d8b1d9233247c956198f1ab (diff) | |
Fix edit server button on windows.
| -rw-r--r-- | src/wx/config_dialog.cc | 15 |
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 |
