Subdivisions are not repeated in combobox

This commit is contained in:
ea4k 2024-08-15 17:44:12 +02:00
parent 2e543f022c
commit c3d55a0a0f
2 changed files with 8 additions and 2 deletions

View File

@ -131,7 +131,7 @@ bool DB_ADIF_Primary_Subdvisions_data::add_Canada_1()
<< "'1', 'New Brunswick', 'NB', 'VE9', '05', '09', '', '-1', '', '', 'N'"
<< "'1', 'New foundland', 'NL', 'VO1', '02', '09', '', '-1', '', '', 'N'"
<< "'1', 'New foundland', 'NL', 'VO1', '05', '09', '', '-1', '', '', 'N'"
<< "'1', 'Yukon', 'YT', 'vy1', '01', '02', '', '-1', '', '', 'N'"
<< "'1', 'Yukon', 'YT', 'VY1', '01', '02', '', '-1', '', '', 'N'"
<< "'1', 'Prince Edward island', 'PE', 'VY2', '05', '09', '', '-1', '', '', 'N'"
<< "'1', 'Nunavut', 'NU', 'VY0', '02', '04', '', '-1', '', '', 'N'"
<< "'1', 'Nunavut', 'NU', 'VY0', '02', '09', '', '-1', '', '', 'N'"

View File

@ -744,10 +744,16 @@ void MainWindowInputOthers::updatePrimarySubdivisionsComboBox(QList<PrimarySubdi
QStringList listOfSubdivisions;
listOfSubdivisions.clear();
QStringList names;
names.clear();
foreach (PrimarySubdivision ps, _subdivisions)
{
QString subdivision = ps.shortName + "-" + ps.name;
listOfSubdivisions.append(subdivision);
if (!listOfSubdivisions.contains(subdivision))
listOfSubdivisions.append(subdivision);
//qDebug() << Q_FUNC_INFO << ": Subdivision added: " << subdivision;
}
if (listOfSubdivisions.count()<1)