Skip to content

Commit

Permalink
Avoid unneccessary settings / ui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pljones committed Oct 24, 2021
1 parent 14c9c46 commit b8ffb8b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,12 +952,21 @@ void CClientSettingsDlg::OnFeedbackDetectionChanged ( int value ) { pSettings->b

void CClientSettingsDlg::OnDirectoryServerAddressEditingFinished()
{
// if the user has selected and deleted an entry in the combo box list,
// we delete the corresponding entry in the directory server address vector
if ( cbxDirectoryServerAddress->currentText().isEmpty() && cbxDirectoryServerAddress->currentData().isValid() )
{
// if the user has selected an entry in the combo box list and deleted the text in the input field,
// and then focus moves off the control without selecting a new entry,
// we delete the corresponding entry in the directory server address vector
pSettings->vstrDirectoryServerAddress[cbxDirectoryServerAddress->currentData().toInt()] = "";
}
else if ( cbxDirectoryServerAddress->currentData().isValid() &&
pSettings->vstrDirectoryServerAddress[cbxDirectoryServerAddress->currentData().toInt()].compare (
NetworkUtil::FixAddress ( cbxDirectoryServerAddress->currentText() ) ) == 0 )
{
// if the user has selected another entry in the combo box list without changing anything,
// there is no need to update any list
return;
}
else
{
// store new address at the top of the list, if the list was already
Expand Down

0 comments on commit b8ffb8b

Please sign in to comment.