KissCount/model/User.cpp
2010-05-27 21:09:02 +02:00

35 lines
711 B
C++

#include "User.h"
User::~User()
{
std::map<unsigned int, std::map<unsigned int, std::list<operation> >* >::iterator it;
for (it = _operations.begin(); it != _operations.end(); it++)
{
if (_operations[it->first])
{
delete it->second;
}
}
}
wxString User::GetCategoryName(wxString catId)
{
if (_preferences._categories.find(catId) == _preferences._categories.end())
return _("Unknown") ;
return _preferences._categories[catId];
}
wxString User::GetAccountName(wxString accountId)
{
if (_accounts.find(accountId) == _accounts.end())
return _("Unknown") ;
return _accounts[accountId].name;
}
int User::GetCategoriesNumber()
{
return _preferences._categories.size();
}