gui2/mp_connect: Fix adding new servers under built-ins

If the current selection was a built-in server, the new server would be
added right below it even if it wasn't the last built-in server,
resulting in a new entry that can't be deleted without closing the
dialog and launching it again to force the server list to be
re-enumerated correctly.
This commit is contained in:
Iris Morelle 2020-01-26 02:05:14 -03:00
parent 57ef823750
commit 1104d3756f

View file

@ -197,7 +197,7 @@ void mp_connect::on_server_add()
const std::size_t mem_pos = selection.user_defined() && !user_servers_.empty()
? 1 + selection.relative_index() : 0;
const unsigned int ui_pos = 1 + selection.row();
const unsigned int ui_pos = selection.user_defined() ? 1 + selection.row() : builtin_servers_.size();
std::string name;