~ci-train-bot/history-service/history-service-ubuntu-zesty-2629

« back to all changes in this revision

Viewing changes to src/contactmatcher.cpp

Move the classes from historyprivate static library to libhistoryservice itself and just keep their header files private.
Approved by: Tiago Salem Herrmann, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
using namespace QtContacts;
38
38
 
 
39
namespace History
 
40
{
 
41
 
39
42
ContactMatcher::ContactMatcher(QContactManager *manager, QObject *parent) :
40
43
    QObject(parent), mManager(manager)
41
44
{
44
47
    }
45
48
 
46
49
    // just trigger the creation of TelepathyHelper
47
 
    connect(TelepathyHelper::instance(), SIGNAL(setupReady()), SLOT(onSetupReady()));
 
50
    connect(History::TelepathyHelper::instance(), SIGNAL(setupReady()), SLOT(onSetupReady()));
48
51
 
49
52
    connect(mManager,
50
53
            SIGNAL(contactsAdded(QList<QContactId>)),
103
106
 
104
107
    QVariantMap map;
105
108
    // and if there was no match, asynchronously request the info, and return an empty map for now
106
 
    if (TelepathyHelper::instance()->ready()) {
 
109
    if (History::TelepathyHelper::instance()->ready()) {
107
110
        map = requestContactInfo(accountId, identifier, synchronous);
108
111
    } else if (!synchronous) {
109
112
        RequestInfo info{accountId, identifier};
406
409
        if (field == "tel") {
407
410
            QList<QContactDetail> details = contact.details(QContactDetail::TypePhoneNumber);
408
411
            Q_FOREACH(const QContactPhoneNumber number, details) {
409
 
                if (PhoneUtils::comparePhoneNumbers(number.number(), identifier)) {
 
412
                if (History::PhoneUtils::comparePhoneNumbers(number.number(), identifier)) {
410
413
                    QVariantMap detailProperties;
411
414
                    detailProperties["phoneSubTypes"] = toVariantList(number.subTypes());
412
415
                    detailProperties["phoneContexts"] = toVariantList(number.contexts());
450
453
        return mAddressableFields[accountId];
451
454
    }
452
455
 
453
 
    Tp::AccountPtr account = TelepathyHelper::instance()->accountForId(accountId);
 
456
    Tp::AccountPtr account = History::TelepathyHelper::instance()->accountForId(accountId);
454
457
    QStringList fields;
455
458
    if (!account.isNull()) {
456
459
        fields = account->protocolInfo().addressableVCardFields();
464
467
{
465
468
    return (map.contains(History::FieldContactId) && !map[History::FieldContactId].toString().isEmpty());
466
469
}
 
470
 
 
471
}