Skip to content

Commit

Permalink
forth commit to resolve jamulussoftware#3233
Browse files Browse the repository at this point in the history
I added return in case the data isn't valid. I also added a ":" to avoid translations problems.
  • Loading branch information
AdamGLIN committed Apr 16, 2024
1 parent 08f40dd commit edcd230
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,13 +1012,26 @@ void CClientSettingsDlg::OnFeedbackDetectionChanged ( int value ) { pSettings->b

void CClientSettingsDlg::OnCustomDirectoriesChanged ( bool bDelete )
{
if ( bDelete && cbxCustomDirectories->currentData().isValid() )
if ( bDelete )
{
if ( !cbxCustomDirectories->currentData().isValid() )
{
// no selected directory to delete
return;
}
// delete the selected directory
pSettings->vstrDirectoryAddress[cbxCustomDirectories->currentData().toInt()] = QString();
}
else if ( !cbxCustomDirectories->currentText().isEmpty() )
else
{

if ( cbxCustomDirectories->currentText().isEmpty() ||
( cbxCustomDirectories->currentData().isValid() && pSettings->vstrDirectoryAddress[cbxCustomDirectories->currentData().toInt()].compare (
NetworkUtil::FixAddress ( cbxCustomDirectories->currentText() ) ) == 0 ) )
{
// no need to add a already added directory
return;
}
// store new address at the top of the list, if the list was already
// full, the last element is thrown out
pSettings->vstrDirectoryAddress.StringFiFoWithCompare ( NetworkUtil::FixAddress ( cbxCustomDirectories->currentText() ) );
Expand Down
2 changes: 1 addition & 1 deletion src/clientsettingsdlgbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@
<item>
<widget class="QLabel" name="lblCustomDirectories">
<property name="text">
<string>Custom Directories</string>
<string>Custom Directories:</string>
</property>
<property name="buddy">
<cstring>cbxCustomDirectories</cstring>
Expand Down

0 comments on commit edcd230

Please sign in to comment.