synchroniser.cpp 762 Bytes
Newer Older
Camilo higuita's avatar
Camilo higuita committed
1
#include "synchroniser.h"
2
#include "./../db/dbactions.h"
Camilo higuita's avatar
Camilo higuita committed
3
#include "vcardproperty.h"
4 5 6 7 8

Synchroniser::Synchroniser(QObject *parent) : QObject (parent)
{
    this->dba = DBActions::getInstance();
}
9 10


Camilo higuita's avatar
Camilo higuita committed
11
FMH::MODEL_LIST Synchroniser::getContacts(const QString &query)
12
{
Camilo higuita's avatar
Camilo higuita committed
13
    return this->dba->getDBData(query);
14
}
Camilo higuita's avatar
Camilo higuita committed
15

16
bool Synchroniser::insertContact(const FMH::MODEL &contact)
17 18 19 20 21 22 23 24 25 26
{   
    return this->dba->insertContact(contact);
}

bool Synchroniser::updateContact(const FMH::MODEL &contact)
{
    return this->dba->updateContact(contact);
}

vCard Synchroniser::tovCard(const FMH::MODEL &contact)
Camilo higuita's avatar
Camilo higuita committed
27
{
28
    Q_UNUSED(contact);
Camilo higuita's avatar
Camilo higuita committed
29 30 31
    vCard vcard;
    vCardProperty name_prop = vCardProperty::createName("Emanuele", "Bertoldi");
    vcard.addProperty(name_prop);
32
    return vcard;
Camilo higuita's avatar
Camilo higuita committed
33
}