mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-01 16:13:57 -04:00
43 lines
743 B
C++
43 lines
743 B
C++
|
#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();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|