mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-06 16:05:09 -04:00
First version of DXCC entity and worked B4 status
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3512 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#include "countriesworked.h"
|
||||
|
||||
void CountriesWorked::init(const QStringList countryNames)
|
||||
{
|
||||
_data.clear();
|
||||
foreach(QString name,countryNames)
|
||||
_data.insert(name,false);
|
||||
}
|
||||
|
||||
void CountriesWorked::setAsWorked(const QString countryName)
|
||||
{
|
||||
if (_data.contains(countryName))
|
||||
_data.insert(countryName,true);
|
||||
}
|
||||
|
||||
bool CountriesWorked::getHasWorked(const QString countryName)
|
||||
{
|
||||
if (_data.contains(countryName))
|
||||
return _data.value(countryName);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int CountriesWorked::getWorkedCount()
|
||||
{
|
||||
int count = 0;
|
||||
foreach (bool value,_data)
|
||||
if (value)
|
||||
count += 1;
|
||||
return count;
|
||||
}
|
||||
|
||||
int CountriesWorked::getSize()
|
||||
{
|
||||
return _data.count();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user