Fixed #122: frequencies should be sorted

This commit is contained in:
Jordan Sherer 2019-02-16 16:09:44 -05:00
parent ee339431c7
commit 35be0fcc29

View File

@ -6958,7 +6958,12 @@ void MainWindow::buildFrequencyMenu(QMenu *menu){
menu->addSeparator(); menu->addSeparator();
foreach(auto f, m_config.frequencies()->frequency_list()){ auto frequencies = m_config.frequencies()->frequency_list();
qSort(frequencies.begin(), frequencies.end(), [](FrequencyList_v2::Item &a, FrequencyList_v2::Item &b) {
return a.frequency_ < b.frequency_;
});
foreach(auto f, frequencies){
auto freq = Radio::pretty_frequency_MHz_string(f.frequency_); auto freq = Radio::pretty_frequency_MHz_string(f.frequency_);
auto const& band = m_config.bands ()->find (f.frequency_); auto const& band = m_config.bands ()->find (f.frequency_);