mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-24 13:58:00 -05:00
49 lines
1001 B
C++
49 lines
1001 B
C++
|
|
#include <module-vfs/vfs.hpp>
|
|
#include "ContactsDB.hpp"
|
|
|
|
const char *ContactsDB::dbName = USER_PATH("contacts.db");
|
|
|
|
uint32_t ContactsDB::favouritesId = 0;
|
|
uint32_t ContactsDB::iceId = 0;
|
|
uint32_t ContactsDB::blockedId = 0;
|
|
|
|
ContactsDB::ContactsDB()
|
|
: Database(dbName), contacts(this), name(this), number(this), ringtones(this), address(this), groups(this)
|
|
{
|
|
|
|
if (contacts.create() == false) {
|
|
return;
|
|
}
|
|
if (name.create() == false) {
|
|
return;
|
|
}
|
|
if (number.create() == false) {
|
|
return;
|
|
}
|
|
if (ringtones.create() == false) {
|
|
return;
|
|
}
|
|
if (address.create() == false) {
|
|
return;
|
|
}
|
|
if (groups.create() == false) {
|
|
return;
|
|
}
|
|
|
|
if (favouritesId == 0) {
|
|
favouritesId = groups.favouritesId();
|
|
}
|
|
if (iceId == 0) {
|
|
iceId = groups.iceId();
|
|
}
|
|
if (blockedId == 0) {
|
|
blockedId = groups.blockedId();
|
|
}
|
|
|
|
isInitialized_ = true;
|
|
}
|
|
|
|
ContactsDB::~ContactsDB()
|
|
{}
|