Priorities for decoded message highlighting and new worked before internal database

Settings option to highlight not worked before entities/grids/calls by
mode. Fix issues with highlighting  decodes and generally refactor the
internal  workings  of  ADIF  and  QSO  recording  for  worked  before
detection.
This commit is contained in:
Bill Somerville
2018-10-25 00:00:19 +01:00
parent c6a3b9a170
commit 8215f3412b
19 changed files with 774 additions and 672 deletions
+17 -35
View File
@@ -1,42 +1,24 @@
#include "countriesworked.h"
void CountriesWorked::init(const QStringList countryNames)
{
_data.clear();
foreach(QString name,countryNames)
_data.insert(name,false);
}
#include <set>
void CountriesWorked::setAsWorked(const QString countryName)
{
if (_data.contains(countryName))
_data.insert(countryName,true);
}
bool CountriesWorked::getHasWorked(const QString countryName) const
{
if (_data.contains(countryName))
return _data.value(countryName);
#include "pimpl_impl.hpp"
return false;
}
int CountriesWorked::getWorkedCount() const
class CountriesWorkedimpl final
{
int count = 0;
foreach (bool value,_data)
if (value)
count += 1;
return count;
}
int CountriesWorked::getSize() const
public:
// element is country-name+band where the '+' is actual a character
// which allows an efficient lower_bound() search for country-name+
// to check for ATNOs
std::set<QString> worked_;
};
void CountriesWorked::add (QString const& country, QString const& band)
{
return _data.count();
m_->worked_.insert (country + '+' + band);
}
bool CountriesWorked::contains (QString const& country, QString const& band) const
{
return m_->worked_.end () != m_->worked_.lower_bound (country + '+' + band);
}