summaryrefslogtreecommitdiff
path: root/models/FrequencyList.cpp
diff options
context:
space:
mode:
authortony mancill <tmancill@debian.org>2024-01-01 11:39:59 -0800
committertony mancill <tmancill@debian.org>2024-01-01 11:39:59 -0800
commite90673af26fd12c1685c5528f1b4cfdd433553c6 (patch)
treee6f7bc67b3035c74b28c7e90cffe8feff73704a7 /models/FrequencyList.cpp
parent94e13d3187f9ec4e4c7f1fdaf989c80a87b8aae7 (diff)
parentffea9660ba79a513401639a2f5d90e2fdc190fb8 (diff)
Update upstream source from tag 'upstream/2.7.0_rc3+repack'
Update to upstream version '2.7.0~rc3+repack' with Debian dir 9101bca1c16d979d1851d72d1d02e5b871ce863d
Diffstat (limited to 'models/FrequencyList.cpp')
-rwxr-xr-xmodels/FrequencyList.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/models/FrequencyList.cpp b/models/FrequencyList.cpp
index 5b7f2be6..2b7317b7 100755
--- a/models/FrequencyList.cpp
+++ b/models/FrequencyList.cpp
@@ -659,7 +659,7 @@ QModelIndex FrequencyList_v2_101::impl::add (Item f)
endInsertRows ();
// if we added one that had a preferred frequency, unprefer everything else
- unprefer_all_but(f, row, {Qt::DisplayRole, Qt::CheckStateRole});
+ if (f.preferred_) unprefer_all_but(f, row, {Qt::DisplayRole, Qt::CheckStateRole});
return index (row, 0);
}
@@ -1335,8 +1335,10 @@ FrequencyList_v2_101::FrequencyItems FrequencyList_v2_101::from_json_file(QFile
{
throw ReadFileException{tr ("No Frequencies were found")};
}
- int valid_entry_count [[maybe_unused]] = 0;
- int skipped_entry_count [[maybe_unused]] = 0;
+#ifdef DUMP_ENTRY_COUNTS
+ int valid_entry_count = 0;
+ int skipped_entry_count = 0;
+#endif
for (auto const &item: arr)
{
QString mode_s, region_s;
@@ -1359,13 +1361,21 @@ FrequencyList_v2_101::FrequencyItems FrequencyList_v2_101::from_json_file(QFile
freq.isSane())
{
list.push_back(freq);
+#ifdef DUMP_ENTRY_COUNTS
valid_entry_count++;
- } else
+#endif
+ } else {
+#ifdef DUMP_ENTRY_COUNTS
skipped_entry_count++;
+#endif
+ }
}
- //MessageBox::information_message(this, tr("Loaded Frequencies from %1").arg(file_name),
- // tr("Entries Valid/Skipped %1").arg(QString::number(valid_entry_count) + "/" +
- // QString::number(skipped_entry_count)));
+
+#ifdef DUMP_ENTRY_COUNTS
+ MessageBox::information_message(this, tr("Loaded Frequencies from %1").arg(file_name),
+ tr("Entries Valid/Skipped %1").arg(QString::number(valid_entry_count) + "/" +
+ QString::number(skipped_entry_count)));
+#endif
return list;
}
// write JSON format to a file