diff --git a/logbook/logbook.cpp b/logbook/logbook.cpp index a154664d5..bb27f8fba 100644 --- a/logbook/logbook.cpp +++ b/logbook/logbook.cpp @@ -32,7 +32,7 @@ void LogBook::match (QString const& call, QString const& mode, QString const& gr bool& ITUZoneB4, QString const& band) const { - if (call.length() > 0) + if (call.size() > 0) { auto const& mode_to_check = (config_ && !config_->highlight_by_mode ()) ? QString {} : mode; callB4 = worked_before_.call_worked (call, mode_to_check, band); @@ -77,30 +77,30 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q QString const& xSent, QString const& xRcvd) { QString t; - t = "" + hisCall; - t += " " + hisGrid; + t = "" + hisCall; + t += " " + hisGrid; if (mode != "FT4") { - t += " " + mode; + t += " " + mode; } else { - t += " MFSK " + mode; + t += " MFSK " + mode; } - t += " " + rptSent; - t += " " + rptRcvd; + t += " " + rptSent; + t += " " + rptRcvd; t += " " + dateTimeOn.date().toString("yyyyMMdd"); t += " " + dateTimeOn.time().toString("hhmmss"); t += " " + dateTimeOff.date().toString("yyyyMMdd"); t += " " + dateTimeOff.time().toString("hhmmss"); - t += " " + band; - t += " " + strDialFreq; - t += " " + myCall; - t += " " + myGrid; - if(txPower!="") t += " " + txPower; - if(comments!="") t += " " + comments; - if(name!="") t += " " + name; - if(operator_call!="") t+=" " + operator_call; + t += " " + band; + t += " " + strDialFreq; + t += " " + myCall; + t += " " + myGrid; + if(txPower!="") t += " " + txPower; + if(comments!="") t += " " + comments; + if(name!="") t += " " + name; + if(operator_call!="") t+=" " + operator_call; if (xSent.size ()) { auto words = xSent.split (' ', QString::SkipEmptyParts); @@ -131,16 +131,27 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q { if (words.at (1).toUInt ()) { - t += " " + words.at (1); + t += " " + words.at (1); } else if (words.at (0).toUInt () && words.at (0).size () > 3) // EU VHF contest exchange { // strip report and set SRX to serial - t += " " + words.at (0).mid (2); + t += " " + words.at (0).mid (2); } else { - t += " " + words.at (1); + if (Configuration::SpecialOperatingActivity::FIELD_DAY == config_->special_op_id ()) + { + // include DX as an ARRL_SECT value even though it is + // not in the ADIF spec ARRL_SECT enumeration, done + // because N1MM does the same + t += " ARRL-FIELD-DAY ' + + words.at (0) + " ' + words.at (1); + } + else if (Configuration::SpecialOperatingActivity::RTTY == config_->special_op_id ()) + { + t += " " + words.at (1); + } } } } diff --git a/logbook/logbook.h b/logbook/logbook.h index c87009e48..858bb64d8 100644 --- a/logbook/logbook.h +++ b/logbook/logbook.h @@ -39,12 +39,12 @@ public: AD1CCty::Record const&, bool& callB4, bool& countryB4, bool &gridB4, bool &continentB4, bool& CQZoneB4, bool& ITUZoneB4, QString const& currentBand = QString {}) const; - static QByteArray QSOToADIF (QString const& hisCall, QString const& hisGrid, QString const& mode, - QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, - QDateTime const& dateTimeOff, QString const& band, QString const& comments, - QString const& name, QString const& strDialFreq, QString const& myCall, - QString const& m_myGrid, QString const& m_txPower, QString const& operator_call, - QString const& xSent, QString const& xRcvd); + QByteArray QSOToADIF (QString const& hisCall, QString const& hisGrid, QString const& mode, + QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, + QDateTime const& dateTimeOff, QString const& band, QString const& comments, + QString const& name, QString const& strDialFreq, QString const& myCall, + QString const& m_myGrid, QString const& m_txPower, QString const& operator_call, + QString const& xSent, QString const& xRcvd); Q_SIGNAL void finished_loading (int worked_before_record_count, QString const& error) const; diff --git a/widgets/logqso.cpp b/widgets/logqso.cpp index 2eaedf116..14c92358b 100644 --- a/widgets/logqso.cpp +++ b/widgets/logqso.cpp @@ -202,23 +202,23 @@ void LogQSO::accept() , m_myGrid , xsent , xrcvd - , LogBook::QSOToADIF (hisCall - , hisGrid - , mode - , rptSent - , rptRcvd - , dateTimeOn - , dateTimeOff - , band - , m_comments - , name - , strDialFreq - , m_myCall - , m_myGrid - , m_txPower - , operator_call - , xsent - , xrcvd)); + , m_log->QSOToADIF (hisCall + , hisGrid + , mode + , rptSent + , rptRcvd + , dateTimeOn + , dateTimeOff + , band + , m_comments + , name + , strDialFreq + , m_myCall + , m_myGrid + , m_txPower + , operator_call + , xsent + , xrcvd)); QDialog::accept(); }