Don't use hardcoded index
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
parent
e77e439c4b
commit
4427ad1451
1 changed files with 8 additions and 5 deletions
|
@ -190,17 +190,20 @@ void DlgConnect::rebuildComboBoxList(int failure)
|
||||||
UserConnection_Information uci;
|
UserConnection_Information uci;
|
||||||
savedHostList = uci.getServerInfo();
|
savedHostList = uci.getServerInfo();
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
for (const auto &pair : savedHostList) {
|
for (const auto &pair : savedHostList) {
|
||||||
auto tmp = pair.second;
|
auto tmp = pair.second;
|
||||||
QString saveName = tmp.getSaveName();
|
QString saveName = tmp.getSaveName();
|
||||||
if (saveName.size()) {
|
if (saveName.size()) {
|
||||||
previousHosts->addItem(saveName);
|
previousHosts->addItem(saveName);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// On rebuild, set to RR
|
// On rebuild, set to RR
|
||||||
if (previousHosts->count() >= 2) {
|
if (saveName.compare("Rooster Ranges") == 0) {
|
||||||
previousHosts->setCurrentIndex(1);
|
previousHosts->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
++index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
btnRefreshServers->setDisabled(false);
|
btnRefreshServers->setDisabled(false);
|
||||||
|
|
Loading…
Reference in a new issue