From 851b658298afb9bafeda98ffbfa2ade612c656be Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 2 Jun 2019 22:17:11 +0200 Subject: New upstream version 2.1.0~rc6+repack --- logbook/WorkedBefore.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'logbook/WorkedBefore.cpp') diff --git a/logbook/WorkedBefore.cpp b/logbook/WorkedBefore.cpp index daaf18fc..aa65ab65 100644 --- a/logbook/WorkedBefore.cpp +++ b/logbook/WorkedBefore.cpp @@ -18,7 +18,7 @@ #include #include #include - +#include "Configuration.hpp" #include "qt_helpers.hpp" #include "pimpl_impl.hpp" @@ -332,10 +332,15 @@ namespace // will parse a record { auto const& entity = prefixes->lookup (call); + auto mode = extractField (record, "MODE").toUpper (); + if (!mode.size () || "MFSK" == mode) + { + mode = extractField (record, "SUBMODE").toUpper (); + } worked.emplace (call.toUpper () , extractField (record, "GRIDSQUARE").left (4).toUpper () // not interested in 6-digit grids , extractField (record, "BAND").toUpper () - , extractField (record, "MODE").toUpper () + , mode , entity.entity_name , entity.continent , entity.CQ_zone @@ -356,8 +361,9 @@ namespace class WorkedBefore::impl final { public: - impl () + impl (Configuration const * configuration) : path_ {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath (logFileName)} + , prefixes_ {configuration} { } @@ -374,8 +380,10 @@ public: worked_before_database_type worked_; }; -WorkedBefore::WorkedBefore () +WorkedBefore::WorkedBefore (Configuration const * configuration) + : m_ {configuration} { + Q_ASSERT (configuration); connect (&m_->loader_watcher_, &QFutureWatcher::finished, [this] () { QString error; size_t n {0}; @@ -407,9 +415,9 @@ QString const& WorkedBefore::path () const return m_->path_; } -AD1CCty const& WorkedBefore::countries () const +AD1CCty const * WorkedBefore::countries () const { - return m_->prefixes_; + return &m_->prefixes_; } bool WorkedBefore::add (QString const& call -- cgit v1.2.3