729 lines
17 KiB
C++
729 lines
17 KiB
C++
/*
|
|
Copyright 2010-2012 Grégory Soutadé
|
|
|
|
This file is part of KissCount.
|
|
|
|
KissCount is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
KissCount is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <algorithm>
|
|
|
|
#include "KissCount.hpp"
|
|
|
|
#include <view/view.hpp>
|
|
|
|
std::vector<ImportEngine*> * KissCount::_importEngines;
|
|
std::vector<ExportEngine*> * KissCount::_exportEngines;
|
|
|
|
KissCount::KissCount(int& argc, char** argv) : QApplication(argc, argv), _user(0)
|
|
{
|
|
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
|
|
|
|
_wxUI = new wxUI(this, "KissCount");
|
|
|
|
_wxUI->showMaximized();
|
|
_wxUI->setDisabled(true);
|
|
|
|
try
|
|
{
|
|
_db = new Database((argc == 2) ? argv[1] : 0, this);
|
|
}
|
|
catch (std::string s)
|
|
{
|
|
_wxUI->close();
|
|
throw s;
|
|
}
|
|
|
|
_wxUI->ChangeUser();
|
|
_wxUI->setDisabled(false);
|
|
}
|
|
|
|
KissCount::~KissCount()
|
|
{
|
|
delete _db;
|
|
delete _wxUI;
|
|
delete _importEngines;
|
|
delete _exportEngines;
|
|
|
|
if (_user) delete _user;
|
|
}
|
|
|
|
std::list<QString> KissCount::GetUsers()
|
|
{
|
|
return _db->GetUsers();
|
|
}
|
|
|
|
bool KissCount::IsValidUser(const QString& user, const QString& password)
|
|
{
|
|
return _db->IsValidUser(user, password) ;
|
|
}
|
|
|
|
void KissCount::LoadUser(const QString& user)
|
|
{
|
|
if (_user) delete _user;
|
|
_user = _db->LoadUser(user) ;
|
|
|
|
if (_user)
|
|
_wxUI->LoadUser();
|
|
}
|
|
|
|
void KissCount::LoadYear(int year, bool force)
|
|
{
|
|
if (!force && _user->_operations[year] != 0) return;
|
|
|
|
if (_user->_operations[year] != 0)
|
|
{
|
|
delete _user->_operations[year];
|
|
_user->_operations[year] = 0;
|
|
}
|
|
|
|
_db->LoadYear(_user, year);
|
|
}
|
|
|
|
User* KissCount::GetUser()
|
|
{
|
|
return _user;
|
|
}
|
|
|
|
int KissCount::GetAccountAmount(int id, int month, int year, bool* had_value, bool create_if_not_exsits)
|
|
{
|
|
return _db->GetAccountAmount(id, month, year, had_value, create_if_not_exsits);
|
|
}
|
|
|
|
int KissCount::CalcAccountAmount(int id, int month, int year, bool* had_values)
|
|
{
|
|
return _db->CalcAccountAmount(id, month, year, had_values);
|
|
}
|
|
|
|
void KissCount::UpdateOperation(Operation& op, bool checkTransfert)
|
|
{
|
|
if(!op.meta)
|
|
|
|
// Unlink
|
|
if (checkTransfert)
|
|
{
|
|
op.transfert = 0;
|
|
_user->LinkOrUnlinkOperation(op);
|
|
}
|
|
|
|
_db->UpdateOperation(_user, op, checkTransfert);
|
|
|
|
// Link
|
|
if (checkTransfert)
|
|
_user->LinkOrUnlinkOperation(op);
|
|
}
|
|
|
|
int KissCount::AddOperation(Operation& op, bool checkTransfert)
|
|
{
|
|
int accountAmount;
|
|
int ret = _db->AddOperation(_user, op, checkTransfert);
|
|
|
|
if (checkTransfert && op.transfert)
|
|
_user->LinkOrUnlinkOperation(op);
|
|
|
|
return ret;
|
|
}
|
|
|
|
void KissCount::DeleteOperation(Operation& op)
|
|
{
|
|
int accountAmount;
|
|
|
|
if (op.transfert)
|
|
{
|
|
op.transfert = 0;
|
|
_user->LinkOrUnlinkOperation(op);
|
|
}
|
|
|
|
_db->DeleteOperation(_user, op);
|
|
}
|
|
|
|
void KissCount::DeleteOperations(int month, int year)
|
|
{
|
|
_db->DeleteOperations(_user, month, year);
|
|
if (month != -1)
|
|
(*_user->_operations[year]).erase(month);
|
|
|
|
if (month == -1 || !_user->_operations[year]->size())
|
|
{
|
|
delete _user->_operations[year];
|
|
_user->_operations.erase(year);
|
|
}
|
|
}
|
|
|
|
int KissCount::MetaAmount(int id)
|
|
{
|
|
return _db->MetaAmount(id);
|
|
}
|
|
|
|
int KissCount::MetaPositiveAmount(int id)
|
|
{
|
|
return _db->MetaPositiveAmount(id);
|
|
}
|
|
|
|
void KissCount::SetAccountAmount(int accountId, int month, int year, int amount)
|
|
{
|
|
_db->SetAccountAmount(accountId, month, year, amount);
|
|
}
|
|
|
|
int KissCount::AddAccount(Account& ac)
|
|
{
|
|
QDate curDate = QDate::currentDate();
|
|
|
|
ac.id = _db->AddAccount(_user, ac);
|
|
_user->AddAccount(ac);
|
|
|
|
SetAccountAmount(ac.id, curDate.month()-1, curDate.year(), 0.0);
|
|
|
|
return ac.id;
|
|
}
|
|
|
|
void KissCount::UpdateAccount(Account& ac)
|
|
{
|
|
_db->UpdateAccount(ac);
|
|
_user->UpdateAccount(ac);
|
|
}
|
|
|
|
void KissCount::DeleteAccount(Account& ac, int replacement)
|
|
{
|
|
std::map<unsigned int, std::map<unsigned int, std::vector<Operation> >* >::iterator it2;
|
|
|
|
_db->DeleteAccount(_user, ac, replacement);
|
|
_user->DeleteAccount(ac);
|
|
|
|
for (it2= _user->_operations.begin();
|
|
it2 != _user->_operations.end();
|
|
it2++)
|
|
LoadYear(it2->first, true);
|
|
}
|
|
|
|
void KissCount::AddSharedAccount(Account& ac, const QString& granted)
|
|
{
|
|
_db->AddSharedAccount(ac, granted);
|
|
}
|
|
|
|
void KissCount::RemoveSharedAccount(Account& ac, int granted)
|
|
{
|
|
_db->RemoveSharedAccount(ac, granted);
|
|
}
|
|
|
|
std::map<QString, QString> KissCount::getSharedAccountOwners(int account)
|
|
{
|
|
return _db->getSharedAccountOwners(account);
|
|
}
|
|
|
|
QString KissCount::getSharedAccountOwner(int account)
|
|
{
|
|
return _db->getSharedAccountOwner(account);
|
|
}
|
|
|
|
int KissCount::AddCategory(Category& category)
|
|
{
|
|
category.id = _db->AddCategory(_user, category);
|
|
_user->AddCategory(category);
|
|
|
|
return category.id;
|
|
}
|
|
|
|
void KissCount::UpdateCategory(Category& category)
|
|
{
|
|
_db->UpdateCategory(category);
|
|
_user->UpdateCategory(category);
|
|
}
|
|
|
|
void KissCount::DeleteCategory(Category& category, int replacement)
|
|
{
|
|
std::map<unsigned int, std::map<unsigned int, std::vector<Operation> >* >::iterator it;
|
|
|
|
_db->DeleteCategory(_user, category, replacement);
|
|
_user->DeleteCategory(category);
|
|
|
|
for (it= _user->_operations.begin();
|
|
it != _user->_operations.end();
|
|
it++)
|
|
LoadYear(it->first, true);
|
|
}
|
|
|
|
int KissCount::AddTag(Tag& tag)
|
|
{
|
|
tag.id = _db->AddTag(_user, tag);
|
|
_user->AddTag(tag);
|
|
|
|
return tag.id;
|
|
}
|
|
|
|
void KissCount::UpdateTag(Tag& tag)
|
|
{
|
|
_db->UpdateTag(tag);
|
|
_user->UpdateTag(tag);
|
|
}
|
|
|
|
void KissCount::DeleteTag(Tag& tag, int replacement)
|
|
{
|
|
std::map<unsigned int, std::map<unsigned int, std::vector<Operation> >* >::iterator it;
|
|
|
|
_db->DeleteTag(_user, tag, replacement);
|
|
_user->DeleteTag(tag);
|
|
|
|
for (it= _user->_operations.begin();
|
|
it != _user->_operations.end();
|
|
it++)
|
|
LoadYear(it->first, true);
|
|
}
|
|
|
|
std::map<int, std::vector<int> > KissCount::GetAllOperations()
|
|
{
|
|
return _db->GetAllOperations(_user);
|
|
}
|
|
|
|
int KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearTo)
|
|
{
|
|
std::vector<Operation>::iterator it, it2;
|
|
std::map<int, int> meta;
|
|
Operation op;
|
|
int nb_update_days = 0;
|
|
|
|
_db->GenerateMonth(_user, monthFrom, yearFrom, monthTo, yearTo);
|
|
|
|
if (!_user->_operations[yearTo])
|
|
_user->_operations[yearTo] = new std::map<unsigned int, std::vector<Operation> >();
|
|
|
|
if (monthFrom != -1 && yearFrom != -1)
|
|
{
|
|
LoadYear(yearFrom, false);
|
|
|
|
for(it = (*_user->_operations[yearFrom])[monthFrom].begin();
|
|
it != (*_user->_operations[yearFrom])[monthFrom].end();
|
|
it++)
|
|
{
|
|
if (!it->fix_cost) continue;
|
|
op = *it;
|
|
op.month = monthTo;
|
|
op.year = yearTo;
|
|
op.checked = false;
|
|
op.id = AddOperation(op);
|
|
op.childs.clear();
|
|
if (op.meta)
|
|
meta[it->id] = op.id;
|
|
|
|
if (!QDate::isValid(op.year, op.month+1, op.day+1))
|
|
{
|
|
QDate d(op.year, op.month+1, 1);
|
|
op.day = d.daysInMonth()-1;
|
|
nb_update_days++;
|
|
}
|
|
|
|
(*_user->_operations[yearTo])[monthTo].push_back(op);
|
|
}
|
|
|
|
// Re Generate parents
|
|
for(it = (*_user->_operations[yearTo])[monthTo].begin();
|
|
it != (*_user->_operations[yearTo])[monthTo].end();
|
|
it++)
|
|
{
|
|
if (it->parent)
|
|
{
|
|
it->parent = meta[it->parent];
|
|
UpdateOperation(*it);
|
|
|
|
for(it2 = (*_user->_operations[yearTo])[monthTo].begin();
|
|
it2 != (*_user->_operations[yearTo])[monthTo].end();
|
|
it2++)
|
|
if (it2->id == it->parent)
|
|
{
|
|
it2->childs.push_back(it->id);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_wxUI->GenerateMonth(monthTo, yearTo);
|
|
|
|
return nb_update_days;
|
|
}
|
|
|
|
void KissCount::ChangePassword(const QString& password)
|
|
{
|
|
_db->ChangePassword(_user, password);
|
|
}
|
|
|
|
bool KissCount::UserExists(const QString& name)
|
|
{
|
|
return _db->UserExists(name);
|
|
}
|
|
|
|
void KissCount::ChangeName(const QString& name)
|
|
{
|
|
_db->ChangeName(_user, name);
|
|
_user->_name = name;
|
|
}
|
|
|
|
// To enable translation during xgettext
|
|
QString default_cats[] = {
|
|
_("Fix"), _("Groceries"), _("Hobbies"), _("Car"),
|
|
_("Unexpected"), _("Other")
|
|
};
|
|
|
|
void KissCount::NewUser(const QString& name)
|
|
{
|
|
// QDate curDate = QDate::currentDate();
|
|
Account ac = {
|
|
/*.id = */0,
|
|
/*.name = */_("Account 1"),
|
|
/*.number = */0,
|
|
/*.shared = */false,
|
|
/*.blocked = */false,
|
|
/*._default = */true,
|
|
/*.is_owner = */true};
|
|
Category cat ;
|
|
|
|
_db->NewUser(name);
|
|
if (_user) delete _user;
|
|
_user = _db->LoadUser(name) ;
|
|
|
|
AddAccount(ac);
|
|
|
|
cat.parent = 0 ; cat.name = "Fix" ; cat.backcolor = view::OWN_YELLOW ; cat.forecolor = Qt::black; cat.fix_cost = true;
|
|
AddCategory(cat);
|
|
cat.parent = 0 ; cat.name = "Groceries" ; cat.backcolor = view::OWN_GREEN; cat.forecolor = Qt::black; cat.fix_cost = false;
|
|
AddCategory(cat);
|
|
cat.parent = 0 ; cat.name = "Hobbies" ; cat.backcolor = view::OWN_GREEN; cat.forecolor = Qt::black; cat.fix_cost = false;
|
|
AddCategory(cat);
|
|
cat.parent = 0 ; cat.name = "Car" ; cat.backcolor = view::OWN_GREEN; cat.forecolor = Qt::black; cat.fix_cost = false;
|
|
AddCategory(cat);
|
|
cat.parent = 0 ; cat.name = "Unexpected" ; cat.backcolor = view::OWN_GREEN; cat.forecolor = Qt::black; cat.fix_cost = false;
|
|
AddCategory(cat);
|
|
cat.parent = 0 ; cat.name = "Other" ; cat.backcolor = view::OWN_GREEN; cat.forecolor = Qt::black; cat.fix_cost = false;
|
|
AddCategory(cat);
|
|
|
|
SetOperationOrder("ASC");
|
|
}
|
|
|
|
void KissCount::KillMe()
|
|
{
|
|
_wxUI->KillMe();
|
|
_db->KillMe(_user);
|
|
delete _user;
|
|
_user = 0;
|
|
_wxUI->ChangeUser();
|
|
}
|
|
|
|
void KissCount::SetLanguage(QString language)
|
|
{
|
|
_user->SetLanguage(language);
|
|
}
|
|
|
|
QString KissCount::GetLanguage(void)
|
|
{
|
|
return _user->GetLanguage();
|
|
}
|
|
|
|
void KissCount::SetAccountLimitValue(int limit)
|
|
{
|
|
_user->SetAccountLimitValue(limit);
|
|
}
|
|
|
|
void KissCount::SetAccountLimitColor(QColor& color)
|
|
{
|
|
_user->SetAccountLimitColor(color);
|
|
}
|
|
|
|
int KissCount::GetAccountLimitValue(void)
|
|
{
|
|
return _user->GetAccountLimitValue();
|
|
}
|
|
|
|
QColor KissCount::GetAccountLimitColor(void)
|
|
{
|
|
return _user->GetAccountLimitColor();
|
|
}
|
|
|
|
/*
|
|
ASC (default) or DESC
|
|
*/
|
|
void KissCount::SetOperationOrder(const QString& order)
|
|
{
|
|
_user->_preferences["operation_order"] = order;
|
|
_db->UpdatePreference(_user, "operation_order");
|
|
}
|
|
|
|
const QString& KissCount::GetOperationOrder()
|
|
{
|
|
return _user->_preferences["operation_order"] ;
|
|
}
|
|
|
|
std::vector<Operation>* KissCount::Search(QString* description, QDate* dateFrom, QDate* dateTo,
|
|
int* amountFrom, int* amountTo,
|
|
std::vector<int> categories,
|
|
int types, std::vector<int> accounts, std::vector<int> tags)
|
|
{
|
|
|
|
return _db->Search(_user, description, dateFrom, dateTo, amountFrom, amountTo, categories, types, accounts, true, tags);
|
|
}
|
|
|
|
bool KissCount::SearchPreviousOperation(Operation* res, Operation& op, int month, int year, bool limitToType, int index)
|
|
{
|
|
std::vector<Operation>* operations;
|
|
//wxDateSpan threeMonths(0, 3); Not working :(
|
|
std::vector<int> v;
|
|
int i;
|
|
|
|
month -= 3;
|
|
if (month < 0)
|
|
{
|
|
year -= 1;
|
|
month += 12;
|
|
}
|
|
|
|
QDate date = QDate(year, month, 0);
|
|
|
|
if (limitToType)
|
|
operations = _db->Search(_user, &op.description, &date, 0, 0, 0, v, op.fix_cost ? +Database::FIX_OP : +Database::NON_FIX_OP, v, false, v);
|
|
else
|
|
operations = _db->Search(_user, &op.description, &date, 0, 0, 0, v, Database::ALL_OP, v, false, v);
|
|
|
|
if (!operations->size())
|
|
{
|
|
delete operations;
|
|
return false;
|
|
}
|
|
|
|
for(i=operations->size()-1; i>=0; i--)
|
|
if (!(*operations)[i].meta && index--)
|
|
{
|
|
*res = (*operations)[i];
|
|
delete operations;
|
|
return true;
|
|
}
|
|
|
|
delete operations;
|
|
|
|
return false;
|
|
}
|
|
|
|
void KissCount::GetHistory(int month, int year, QStringList& list)
|
|
{
|
|
month -= 3;
|
|
if (month < 0)
|
|
{
|
|
year -= 1;
|
|
month += 12;
|
|
}
|
|
|
|
_db->GetHistory(month, year, list);
|
|
}
|
|
|
|
void KissCount::GetStats(int monthFrom, int yearFrom, int monthTo, int yearTo,
|
|
std::map<int, std::map<int, std::map<int, int> > >* accountAmounts,
|
|
std::map<int, int>* categories, std::map<int, int>* tags)
|
|
{
|
|
_db->GetStats(_user, monthFrom, yearFrom, monthTo, yearTo, accountAmounts, categories, tags);
|
|
}
|
|
|
|
void KissCount::GetMonthStats(int month, int year, int nbDays,
|
|
std::map<int, std::vector<int> >* operations,
|
|
std::map<int, int>* categories, std::map<int, int>* tags)
|
|
{
|
|
_db->GetMonthStats(_user, month, year, nbDays, operations, categories, tags);
|
|
}
|
|
|
|
void KissCount::UpdateStats()
|
|
{
|
|
_wxUI->UpdateStats();
|
|
}
|
|
|
|
std::map<int, int>* KissCount::GetNotChecked(int month, int year)
|
|
{
|
|
return _db->GetNotChecked(_user, month, year);
|
|
}
|
|
|
|
std::map<int, int>* KissCount::GetVirtualAmount(int month, int year)
|
|
{
|
|
return _db->GetVirtualAmount(_user, month, year);
|
|
}
|
|
|
|
QFont KissCount::ExtractFont(QString strFont)
|
|
{
|
|
long int pointSize, weight, family, style;
|
|
QString faceName;
|
|
|
|
if (!strFont.size())
|
|
{
|
|
DEFAULT_FONT(f);
|
|
return f;
|
|
}
|
|
QStringList list = strFont.split(";");
|
|
|
|
pointSize = list[0].toInt();
|
|
family = list[1].toInt();
|
|
style = list[2].toInt();
|
|
weight = list[3].toInt();
|
|
faceName = list[4];
|
|
|
|
(void) family;
|
|
(void) style;
|
|
|
|
return QFont(faceName, pointSize, weight);
|
|
}
|
|
|
|
QString KissCount::CompactFont(const QFont& font)
|
|
{
|
|
QString res ;
|
|
res = res.sprintf("%d;%d;%d;%d;", font.pointSize(), 0, 0, font.weight());
|
|
res += font.family();
|
|
|
|
return res;
|
|
}
|
|
|
|
void KissCount::UnRegisterImportEngine(ImportEngine* engine)
|
|
{
|
|
std::vector<ImportEngine*>* importEngines = KissCount::GetImportEngines();
|
|
|
|
std::vector<ImportEngine*>::iterator it = std::find(importEngines->begin(), importEngines->end(), engine);
|
|
|
|
if (it!=importEngines->end()) importEngines->erase(it);
|
|
}
|
|
|
|
void KissCount::RegisterImportEngine(ImportEngine* engine)
|
|
{
|
|
std::vector<ImportEngine*>* importEngines = KissCount::GetImportEngines();
|
|
|
|
importEngines->push_back(engine);
|
|
}
|
|
|
|
QString KissCount::GetImportEngineExtensions()
|
|
{
|
|
QString res;
|
|
std::vector<ImportEngine*>::iterator it;
|
|
int i;
|
|
std::vector<ImportEngine*>* importEngines = KissCount::GetImportEngines();
|
|
|
|
for(i=0; i<(int)importEngines->size()-1; i++)
|
|
res = res + (*importEngines)[i]->GetFileExt() + ";;" ;
|
|
|
|
if (importEngines->size())
|
|
res = res + (*importEngines)[i]->GetFileExt();
|
|
|
|
return res;
|
|
}
|
|
|
|
ImportEngine* KissCount::GetImportEngine(QString path)
|
|
{
|
|
std::vector<ImportEngine*>::iterator it;
|
|
std::vector<ImportEngine*>* importEngines = KissCount::GetImportEngines();
|
|
|
|
for(it=importEngines->begin(); it!=importEngines->end(); it++)
|
|
{
|
|
if ((*it)->HandleFile(path, _user, _db, this))
|
|
return *it;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
void KissCount::UpdateImportPattern()
|
|
{
|
|
_db->UpdateImportPattern(_user);
|
|
}
|
|
|
|
void KissCount::UnRegisterExportEngine(ExportEngine* engine)
|
|
{
|
|
std::vector<ExportEngine*>* exportEngines = KissCount::GetExportEngines();
|
|
|
|
std::vector<ExportEngine*>::iterator it = std::find(exportEngines->begin(), exportEngines->end(), engine);
|
|
|
|
if (it!=exportEngines->end()) exportEngines->erase(it);
|
|
}
|
|
|
|
void KissCount::RegisterExportEngine(ExportEngine* engine)
|
|
{
|
|
std::vector<ExportEngine*>* exportEngines = KissCount::GetExportEngines();
|
|
|
|
exportEngines->push_back(engine);
|
|
}
|
|
|
|
QString KissCount::GetExportEngineExtensions()
|
|
{
|
|
QString res;
|
|
std::vector<ExportEngine*>::iterator it;
|
|
int i;
|
|
std::vector<ExportEngine*>* exportEngines = KissCount::GetExportEngines();
|
|
|
|
for(i=0; i<(int)exportEngines->size()-1; i++)
|
|
res = res + (*exportEngines)[i]->GetFileExt() + ";;" ;
|
|
|
|
if (exportEngines->size())
|
|
res = res + (*exportEngines)[i]->GetFileExt();
|
|
|
|
return res;
|
|
}
|
|
|
|
ExportEngine* KissCount::GetExportEngine(QString path, QString filter)
|
|
{
|
|
std::vector<ExportEngine*>::iterator it;
|
|
std::vector<ExportEngine*>* exportEngines = KissCount::GetExportEngines();
|
|
QString tmp;
|
|
|
|
for(it=exportEngines->begin(); it!=exportEngines->end(); it++)
|
|
{
|
|
if (filter == (*it)->GetFileExt())
|
|
{
|
|
tmp = path;
|
|
if (!tmp.endsWith((*it)->GetShortExt()))
|
|
tmp += (*it)->GetShortExt();
|
|
if ((*it)->HandleFile(tmp, _user, _db, this))
|
|
return *it;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
std::vector<ImportEngine*>* KissCount::GetImportEngines()
|
|
{
|
|
if (!_importEngines)
|
|
_importEngines = new std::vector<ImportEngine*>;
|
|
|
|
return _importEngines;
|
|
}
|
|
|
|
std::vector<ExportEngine*>* KissCount::GetExportEngines()
|
|
{
|
|
if (!_exportEngines)
|
|
_exportEngines = new std::vector<ExportEngine*>;
|
|
|
|
return _exportEngines;
|
|
}
|
|
|
|
bool KissCount::ChangeDatabase(QString filename)
|
|
{
|
|
return _db->ChangeDatabase(filename);
|
|
}
|
|
|
|
QLocale* KissCount::GetLocale()
|
|
{
|
|
return _wxUI->GetLocale();
|
|
}
|
|
|
|
QString KissCount::GetDateFormat()
|
|
{
|
|
return _wxUI->GetDateFormat();
|
|
}
|
|
|
|
QString KissCount::FormatDate(int day, int month, int year)
|
|
{
|
|
return QDate(year, month, day).toString(_wxUI->GetDateFormat());
|
|
}
|