Consolidate ADIF generation into a single serializer - #1046
Open
ea4k wants to merge 2 commits into
Open
Conversation
The ADIF export functions (getADIFStandard/getADIFLoTW/getADIFClubLog) were fixed in PR #1039 to skip BAND_RX when the RX band is empty, "0", or equal to BAND. The Club Log real-time upload built its BAND_RX field independently with a `length() > 2` heuristic, which was not updated. That heuristic happens to drop empty and "0" values, but it also drops legitimate 2-character RX bands such as 6m, 4m and 2m. Replace it with the same guard used on the export path: emit BAND_RX only when it is non-empty, not "0", and different from BAND. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LMqkGaCivPaos391iJ9MeT
Follow-up refactor so the ADIF record is always produced by the same function. - QSO::getADIF() now always serializes through QSO::getADIFStandard(). The per-destination writers getADIFLoTW(), getADIFClubLog() and getADIFeQSL() were dead code: nothing ever called getADIF() with ModeLotW/ModeEQSL and there was no ModeClubLog branch, while the actual LoTW/eQSL/Club Log file exports already went through getADIFStandard() and restricted the fields at the SQL SELECT level. Removed those three unused functions and their declarations. - Moved the BAND/BAND_RX "0" rule into Adif::getADIFField() so it is enforced in a single place for every field that goes through it, and restored the simpler same-as-BAND guard in getADIFStandard(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LMqkGaCivPaos391iJ9MeT
|
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Started as a follow-up to #1039 (guarding
BAND_RXagainst empty/"0"values) and grew into a consolidation of how KLog produces ADIF, so the ADIF file is always written by the same function.Changes
1. Club Log real-time upload —
src/elog/elogclublog.cppThe real-time uploader built
BAND_RXby hand with alength() > 2heuristic that was never updated with #1039. That heuristic drops empty/"0"but also drops legitimate 2‑character RX bands (6m,4m,2m). Replaced with the same guard used on the export path (non-empty, not"0", different fromBAND).2. Single ADIF serializer —
src/qso.cpp,src/qso.hQSO::getADIF()now always serializes throughQSO::getADIFStandard(). The per-destination writersgetADIFLoTW(),getADIFClubLog()andgetADIFeQSL()were dead code:getADIF()withModeLotW/ModeEQSL, and there was noModeClubLogbranch;getADIFStandard()and restricted the fields at the SQLSELECTlevel (FileManager::adifQSOsExport).Removed the three unused functions and their declarations.
3. Centralized band validation —
src/adif.cppMoved the "a band is never
0" rule intoAdif::getADIFField()soBAND/BAND_RXplaceholders are dropped in one single place for every caller, and restored the simpler same-as-BANDguard ingetADIFStandard().Scope / what is intentionally not in this PR
Two items from the same discussion are not included because they change untestable, outward-facing behavior and this repo can't be built in my environment (no Qt toolchain); I'd rather do them with a real build+test cycle:
QSO::getADIF. Today it assembles a 16‑fieldQStringList(getClubLogRealTimeFromId+getClubLogAdif). Unifying it would change the payload sent to Club Log's realtime endpoint, which I can't verify here.getADIFFromQSOQueryvsQSO::fromDB, flagged by an existingTODO). Large refactor across ~100 fields, only tangential to "the ADIF file is written by one function".Testing
Not built locally (no Qt toolchain available). Static review only; relying on CI. Note the AppVeyor check was already red on #1039's head before these commits.
🤖 Generated with Claude Code