Commit 49c3d87e authored by mardy's avatar mardy Committed by Sergey Chupligin

[qtcontacts-sqlite] Build with newer QtPim

With this commit, the build succeeds and the tests pass. However, the
module is still not functional under the new QtPim, as the
implementation of the virtual methods responsible for handling the new
Collections API have not been implemented.
parent d8070437
......@@ -7,3 +7,7 @@ packagesExist(mlite5) {
DEFINES += HAS_MLITE
PKGCONFIG += mlite5
}
!lessThan(QT_VERSION, 5.9) {
DEFINES += NEW_QTPIM
}
/*
* Copyright (C) 2013 Jolla Ltd. <chris.adams@jollamobile.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* "Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Nemo Mobile nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/
#include "contactid_p.h"
#include <QContact>
#include <QContactManager>
#include <QDebug>
namespace {
const QString default_uri = QString::fromLatin1("org.nemomobile.contacts.sqlite");
QString dbIdToString(quint32 dbId)
{
return QString::fromLatin1("sql-%1").arg(dbId);
}
quint32 dbIdFromString(const QString &s)
{
if (s.startsWith(QString::fromLatin1("sql-"))) {
return s.mid(4).toUInt();
}
return 0;
}
}
#include <QContactManagerEngine>
QContactId ContactId::apiId(const QContact &contact)
{
return contact.id();
}
#ifndef NEW_QTPIM
QContactId ContactId::apiId(quint32 dbId)
{
ContactId *eid = new ContactId(dbId);
return QContactId(eid);
}
#endif
quint32 ContactId::databaseId(const QContact &contact)
{
return databaseId(contact.id());
}
quint32 ContactId::databaseId(const QContactId &apiId)
{
if (const QContactEngineId *eid = QContactManagerEngine::engineId(apiId)) {
const ContactId *iid = static_cast<const ContactId*>(eid);
return iid->m_databaseId;
}
return 0;
}
const QContactId &ContactId::contactId(const QContactId &apiId)
{
return apiId;
}
QContactId ContactId::fromString(const QString &s)
{
return apiId(dbIdFromString(s));
}
ContactId::ContactId(quint32 dbId)
: QContactEngineId()
, m_databaseId(dbId)
{
}
ContactId::ContactId(const QString &s)
: QContactEngineId()
, m_databaseId(dbIdFromString(s))
{
}
bool ContactId::isEqualTo(const QContactEngineId *other) const
{
return m_databaseId == static_cast<const ContactId*>(other)->m_databaseId;
}
bool ContactId::isLessThan(const QContactEngineId *other) const
{
return m_databaseId < static_cast<const ContactId*>(other)->m_databaseId;
}
QString ContactId::managerUri() const
{
return QContactManager::buildUri(default_uri, QMap<QString, QString>());
}
QContactEngineId* ContactId::clone() const
{
return new ContactId(m_databaseId);
}
QString ContactId::toString() const
{
return dbIdToString(m_databaseId);
}
uint ContactId::hash() const
{
return m_databaseId;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug &ContactId::debugStreamOut(QDebug &dbg) const
{
return dbg << dbIdToString(m_databaseId);
}
#endif // QT_NO_DEBUG_STREAM
bool ContactId::isValid(const QContact &contact)
{
return isValid(databaseId(contact));
}
bool ContactId::isValid(const QContactId &contactId)
{
return isValid(databaseId(contactId));
}
bool ContactId::isValid(quint32 dbId)
{
return (dbId != 0);
}
QString ContactId::toString(const QContactId &apiId)
{
return dbIdToString(databaseId(apiId));
}
QString ContactId::toString(const QContact &c)
{
return toString(c.id());
}
......@@ -31,6 +31,7 @@
#include "contactid_p.h"
#include <QByteArray>
#include <QContact>
#include <QContactManager>
#include <QDebug>
......@@ -39,17 +40,14 @@ namespace {
const QString default_uri = QString::fromLatin1("org.nemomobile.contacts.sqlite");
QString dbIdToString(quint32 dbId)
QByteArray dbIdToLocalId(quint32 dbId)
{
return QString::fromLatin1("sql-%1").arg(dbId);
return QByteArray::number(dbId);
}
quint32 dbIdFromString(const QString &s)
quint32 dbIdFromLocalId(const QByteArray &s)
{
if (s.startsWith(QString::fromLatin1("sql-"))) {
return s.mid(4).toUInt();
}
return 0;
return quint32(s.toLongLong());
}
}
......@@ -63,8 +61,8 @@ QContactId ContactId::apiId(const QContact &contact)
QContactId ContactId::apiId(quint32 dbId)
{
ContactId *eid = new ContactId(dbId);
return QContactId(eid);
return QContactId(QContactManager::buildUri(default_uri, QMap<QString, QString>()),
dbIdToLocalId(dbId));
}
quint32 ContactId::databaseId(const QContact &contact)
......@@ -74,11 +72,7 @@ quint32 ContactId::databaseId(const QContact &contact)
quint32 ContactId::databaseId(const QContactId &apiId)
{
if (const QContactEngineId *eid = QContactManagerEngine::engineId(apiId)) {
const ContactId *iid = static_cast<const ContactId*>(eid);
return iid->m_databaseId;
}
return 0;
return dbIdFromLocalId(apiId.localId());
}
const QContactId &ContactId::contactId(const QContactId &apiId)
......@@ -88,58 +82,9 @@ const QContactId &ContactId::contactId(const QContactId &apiId)
QContactId ContactId::fromString(const QString &s)
{
return apiId(dbIdFromString(s));
return apiId(dbIdFromLocalId(s.toUtf8()));
}
ContactId::ContactId(quint32 dbId)
: QContactEngineId()
, m_databaseId(dbId)
{
}
ContactId::ContactId(const QString &s)
: QContactEngineId()
, m_databaseId(dbIdFromString(s))
{
}
bool ContactId::isEqualTo(const QContactEngineId *other) const
{
return m_databaseId == static_cast<const ContactId*>(other)->m_databaseId;
}
bool ContactId::isLessThan(const QContactEngineId *other) const
{
return m_databaseId < static_cast<const ContactId*>(other)->m_databaseId;
}
QString ContactId::managerUri() const
{
return QContactManager::buildUri(default_uri, QMap<QString, QString>());
}
QContactEngineId* ContactId::clone() const
{
return new ContactId(m_databaseId);
}
QString ContactId::toString() const
{
return dbIdToString(m_databaseId);
}
uint ContactId::hash() const
{
return m_databaseId;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug &ContactId::debugStreamOut(QDebug &dbg) const
{
return dbg << dbIdToString(m_databaseId);
}
#endif // QT_NO_DEBUG_STREAM
bool ContactId::isValid(const QContact &contact)
{
return isValid(databaseId(contact));
......@@ -157,11 +102,10 @@ bool ContactId::isValid(quint32 dbId)
QString ContactId::toString(const QContactId &apiId)
{
return dbIdToString(databaseId(apiId));
return dbIdToLocalId(databaseId(apiId));
}
QString ContactId::toString(const QContact &c)
{
return toString(c.id());
}
......@@ -36,11 +36,18 @@
#include <QContactId>
#include <QContact>
#ifndef NEW_QTPIM
#include <QContactEngineId>
#endif
QTCONTACTS_USE_NAMESPACE
class ContactId : public QContactEngineId
class ContactId:
#ifdef NEW_QTPIM
public QContactId
#else
public QContactEngineId
#endif
{
public:
static QContactId apiId(const QContact &contact);
......@@ -60,6 +67,7 @@ public:
static QContactId fromString(const QString &id);
#ifndef NEW_QTPIM
ContactId(quint32 databaseId);
ContactId(const QString &s);
......@@ -78,6 +86,7 @@ public:
private:
quint32 m_databaseId;
#endif
};
#endif // QTCONTACTSSQLITE_CONTACTIDIMPL
......
......@@ -659,11 +659,16 @@ static QContactRelationship makeRelationship(const QString &type, quint32 firstI
QContactRelationship relationship;
relationship.setRelationshipType(type);
#ifdef NEW_QTPIM
relationship.setFirst(ContactId::apiId(firstId));
relationship.setSecond(ContactId::apiId(secondId));
#else
QContact first, second;
first.setId(ContactId::apiId(firstId));
second.setId(ContactId::apiId(secondId));
relationship.setFirst(first);
relationship.setSecond(second);
#endif
return relationship;
}
......@@ -1227,7 +1232,11 @@ static QString buildWhere(const QContactIdFilter &filter, ContactsDatabase &db,
static QString buildWhere(const QContactRelationshipFilter &filter, QVariantList *bindings, bool *failed)
{
#ifdef NEW_QTPIM
QContactId rci = filter.relatedContactId();
#else
QContactId rci = filter.relatedContact().id();
#endif
QContactRelationship::Role rcr = filter.relatedContactRole();
QString rt = filter.relationshipType();
......@@ -2174,8 +2183,13 @@ QContactManager::Error ContactReader::queryContacts(
QContactGender gender;
// Gender is an enum in qtpim
QString genderText = contactQuery.value(col++).toString();
#ifdef NEW_QTPIM
gender.setGender(static_cast<QContactGender::GenderType>(genderText.toInt()));
#else
gender.setGender(static_cast<QContactGender::GenderField>(genderText.toInt()));
#endif
contact.saveDetail(&gender);
QContactFavorite favorite;
......
......@@ -466,8 +466,13 @@ public:
RelationshipFetchJob(QContactRelationshipFetchRequest *request)
: TemplateJob(request)
, m_type(request->relationshipType())
#ifdef NEW_QTPIM
, m_first(request->first())
, m_second(request->second())
#else
, m_first(request->first().id())
, m_second(request->second().id())
#endif
{
}
......@@ -1059,11 +1064,11 @@ bool ContactsEngine::setSelfContactId(
QList<QContactRelationship> ContactsEngine::relationships(
const QString &relationshipType,
const QContact &participant,
const QContactId &participant,
QContactRelationship::Role role,
QContactManager::Error *error) const
{
QContactId first = ContactId::apiId(participant);
QContactId first = participant;
QContactId second;
if (role == QContactRelationship::Second)
......@@ -1077,6 +1082,20 @@ QList<QContactRelationship> ContactsEngine::relationships(
return relationships;
}
#ifndef NEW_QTPIM
QList<QContactRelationship> ContactsEngine::relationships(
const QString &relationshipType,
const QContact &participant,
QContactRelationship::Role role,
QContactManager::Error *error) const
{
return relationships(relationshipType,
ContactId::apiId(participant),
role,
error);
}
#endif
bool ContactsEngine::saveRelationships(
QList<QContactRelationship> *relationships,
QMap<int, QContactManager::Error> *errorMap,
......@@ -1397,13 +1416,21 @@ void ContactsEngine::_q_contactsAdded(const QVector<quint32> &contactIds)
void ContactsEngine::_q_contactsChanged(const QVector<quint32> &contactIds)
{
emit contactsChanged(idList(contactIds));
emit contactsChanged(idList(contactIds)
#ifdef NEW_QTPIM
, QList<QtContacts::QContactDetail::DetailType>()
#endif
);
}
void ContactsEngine::_q_contactsPresenceChanged(const QVector<quint32> &contactIds)
{
if (m_mergePresenceChanges) {
emit contactsChanged(idList(contactIds));
emit contactsChanged(idList(contactIds)
#ifdef NEW_QTPIM
, QList<QtContacts::QContactDetail::DetailType>()
#endif
);
} else {
emit contactsPresenceChanged(idList(contactIds));
}
......
......@@ -58,6 +58,12 @@ inline void operator==(const QContactDetail &, const QContactDetail &) {}
class JobThread;
#ifdef NEW_QTPIM
#define NEW_OVERRIDE override
#else
#define NEW_OVERRIDE
#endif
class ContactsEngine : public QtContactsSqliteExtensions::ContactManagerEngine
{
Q_OBJECT
......@@ -114,11 +120,18 @@ public:
QContactId selfContactId(QContactManager::Error* error) const override;
bool setSelfContactId(const QContactId& contactId, QContactManager::Error* error) override;
QList<QContactRelationship> relationships(
const QString &relationshipType,
const QContactId &participant,
QContactRelationship::Role role,
QContactManager::Error *error) const NEW_OVERRIDE;
#ifndef NEW_QTPIM
QList<QContactRelationship> relationships(
const QString &relationshipType,
const QContact &participant,
QContactRelationship::Role role,
QContactManager::Error *error) const override;
#endif
bool saveRelationships(
QList<QContactRelationship> *relationships,
QMap<int, QContactManager::Error> *errorMap,
......
......@@ -48,8 +48,10 @@ public:
QContactManagerEngine *engine(
const QMap<QString, QString> &parameters, QContactManager::Error* error);
QString managerName() const;
#ifndef NEW_QTPIM
QContactEngineId *createContactEngineId(
const QMap<QString, QString> &parameters, const QString &engineIdString) const;
#endif
};
......@@ -77,11 +79,13 @@ QString ContactsFactory::managerName() const
return QString::fromLatin1("org.nemomobile.contacts.sqlite");
}
#ifndef NEW_QTPIM
QContactEngineId *ContactsFactory::createContactEngineId(
const QMap<QString, QString> &parameters, const QString &engineIdString) const
{
Q_UNUSED(parameters)
return new ContactId(engineIdString);
}
#endif
#include "contactsplugin.moc"
......@@ -413,8 +413,13 @@ QContactManager::Error ContactWriter::saveRelationships(
for (int i = 0; i < relationships.size(); ++i) {
const QContactRelationship &relationship = relationships.at(i);
#ifdef NEW_QTPIM
QContactId first(relationship.first());
QContactId second(relationship.second());
#else
QContactId first(relationship.first().id());
QContactId second(relationship.second().id());
#endif
const quint32 firstId = ContactId::databaseId(first);
const quint32 secondId = ContactId::databaseId(second);
......@@ -2693,7 +2698,11 @@ static void promoteDetailsToLocal(const QList<QContactDetail> addDelta, const QL
localContact->saveDetail(&lts);
} else if (type == detailType<QContactGender>()) {
QContactGender lg = localContact->detail<QContactGender>();
#ifdef NEW_QTPIM
lg.setGender(static_cast<QContactGender::GenderType>(original.value<int>(QContactGender::FieldGender)));
#else
lg.setGender(static_cast<QContactGender::GenderField>(original.value<int>(QContactGender::FieldGender)));
#endif
localContact->saveDetail(&lg);
} else if (type == detailType<QContactFavorite>()) {
QContactFavorite lf = localContact->detail<QContactFavorite>();
......@@ -2735,11 +2744,16 @@ static QContactRelationship makeRelationship(const QString &type, const QContact
QContactRelationship relationship;
relationship.setRelationshipType(type);
#ifdef NEW_QTPIM
relationship.setFirst(firstId);
relationship.setSecond(secondId);
#else
QContact first, second;
first.setId(firstId);
second.setId(secondId);
relationship.setFirst(first);
relationship.setSecond(second);
#endif
return relationship;
}
......
......@@ -51,7 +51,6 @@ SOURCES += \
memorytable.cpp \
semaphore_p.cpp \
conversion.cpp \
contactid.cpp \
contactsdatabase.cpp \
contactsengine.cpp \
contactstransientstore.cpp \
......@@ -60,6 +59,12 @@ SOURCES += \
contactreader.cpp \
contactwriter.cpp
CONFIG(new_qtpim) {
SOURCES += contactid.cpp
} else {
SOURCES += contactengineid.cpp
}
target.path = $$[QT_INSTALL_PLUGINS]/contacts
INSTALLS += target
......
......@@ -11,7 +11,11 @@ HEADERS += \
testsyncadapter.h
SOURCES += \
../../../src/engine/contactid.cpp \
testsyncadapter.cpp \
tst_aggregation.cpp
CONFIG(new_qtpim) {
SOURCES += ../../../src/engine/contactid.cpp
} else {
SOURCES += ../../../src/engine/contactengineid.cpp
}
This diff is collapsed.
......@@ -11,5 +11,10 @@ HEADERS += \
../../util.h \
../../qcontactmanagerdataholder.h
SOURCES += \
../../../src/engine/contactid.cpp \
tst_qcontactmanager.cpp
CONFIG(new_qtpim) {
SOURCES += ../../../src/engine/contactid.cpp
} else {
SOURCES += ../../../src/engine/contactengineid.cpp
}
......@@ -678,6 +678,9 @@ void tst_QContactManager::saveContactName(QContact *contact, QContactDetailDefin
void tst_QContactManager::metadata()
{
#ifdef NEW_QTPIM
QSKIP("Non relevant with newer QtPim");
#endif
// ensure that the backend is publishing its metadata (name / parameters / uri) correctly
QFETCH(QString, uri);
QScopedPointer<QContactManager> cm(newContactManager());
......@@ -1934,7 +1937,13 @@ void tst_QContactManager::nonprivileged()
QScopedPointer<QContactManager> nonprivilegedCm(QContactManager::fromUri(QContactManager::buildUri(managerName, params)));
QVERIFY(nonprivilegedCm);
QVERIFY(!nonprivilegedCm->managerUri().isEmpty());
/* With newer QtPim, the same managerUri() is returned unless the
* parameters affect the validity of contact IDs. therefore, the
* next check is only valid for older QtPim versions */
#ifndef NEW_QTPIM
QVERIFY(nonprivilegedCm->managerUri() != privilegedCm->managerUri());
#endif
QSignalSpy privilegedAddedSpy(privilegedCm.data(), contactsAddedSignal);
QSignalSpy nonprivilegedAddedSpy(nonprivilegedCm.data(), contactsAddedSignal);
......@@ -2474,8 +2483,13 @@ void tst_QContactManager::signalEmission()
QTRY_VERIFY(spyCA.count() >= addSigCount);
addSigCount = spyCA.count();
#ifdef NEW_QTPIM
const char *observerContactChangedSignal = SIGNAL(contactChanged(QList<QContactDetail::DetailType>));
#else
const char *observerContactChangedSignal = SIGNAL(contactChanged());
#endif
QScopedPointer<QContactObserver> c1Observer(new QContactObserver(m1.data(), cid));
QScopedPointer<QSignalSpy> spyCOM1(new QSignalSpy(c1Observer.data(), SIGNAL(contactChanged())));
QScopedPointer<QSignalSpy> spyCOM1(new QSignalSpy(c1Observer.data(), observerContactChangedSignal));
QScopedPointer<QSignalSpy> spyCOR1(new QSignalSpy(c1Observer.data(), SIGNAL(contactRemoved())));
// verify save modified emits signal changed
......@@ -2537,8 +2551,8 @@ void tst_QContactManager::signalEmission()
spyCOR1->clear();
QScopedPointer<QContactObserver> c2Observer(new QContactObserver(m1.data(), ContactId::apiId(c2)));
QScopedPointer<QContactObserver> c3Observer(new QContactObserver(m1.data(), ContactId::apiId(c3)));
QScopedPointer<QSignalSpy> spyCOM2(new QSignalSpy(c2Observer.data(), SIGNAL(contactChanged())));
QScopedPointer<QSignalSpy> spyCOM3(new QSignalSpy(c3Observer.data(), SIGNAL(contactChanged())));
QScopedPointer<QSignalSpy> spyCOM2(new QSignalSpy(c2Observer.data(), observerContactChangedSignal));
QScopedPointer<QSignalSpy> spyCOM3(new QSignalSpy(c3Observer.data(), observerContactChangedSignal));
QScopedPointer<QSignalSpy> spyCOR2(new QSignalSpy(c2Observer.data(), SIGNAL(contactRemoved())));
QScopedPointer<QSignalSpy> spyCOR3(new QSignalSpy(c3Observer.data(), SIGNAL(contactRemoved())));
......@@ -2617,9 +2631,9 @@ void tst_QContactManager::signalEmission()
c1Observer.reset(new QContactObserver(m1.data(), ContactId::apiId(c)));
c2Observer.reset(new QContactObserver(m1.data(), ContactId::apiId(c2)));
c3Observer.reset(new QContactObserver(m1.data(), ContactId::apiId(c3)));
spyCOM1.reset(new QSignalSpy(c1Observer.data(), SIGNAL(contactChanged())));
spyCOM2.reset(new QSignalSpy(c2Observer.data(), SIGNAL(contactChanged())));
spyCOM3.reset(new QSignalSpy(c3Observer.data(), SIGNAL(contactChanged())));
spyCOM1.reset(new QSignalSpy(c1Observer.data(), observerContactChangedSignal));
spyCOM2.reset(new QSignalSpy(c2Observer.data(), observerContactChangedSignal));
spyCOM3.reset(new QSignalSpy(c3Observer.data(), observerContactChangedSignal));
spyCOR1.reset(new QSignalSpy(c1Observer.data(), SIGNAL(contactRemoved())));
spyCOR2.reset(new QSignalSpy(c2Observer.data(), SIGNAL(contactRemoved())));
spyCOR3.reset(new QSignalSpy(c3Observer.data(), SIGNAL(contactRemoved())));
......@@ -3121,13 +3135,28 @@ void tst_QContactManager::changeSet()
QVERIFY(changeSet.removedContacts().isEmpty());
QVERIFY(changeSet.addedContacts().contains(id));
#ifdef NEW_QTPIM
changeSet.insertChangedContact(id,
QList<QtContacts::QContactDetail::DetailType>());
changeSet.insertChangedContacts(QList<QContactId>() << id,
QList<QtContacts::QContactDetail::DetailType>());
#else
changeSet.insertChangedContact(id);
changeSet.insertChangedContacts(QList<QContactId>() << id);
#endif
QVERIFY(changeSet.changedContacts().size() == 1); // set, should only be added once.
QVERIFY(!changeSet.addedContacts().isEmpty());
QVERIFY(!changeSet.changedContacts().isEmpty());
QVERIFY(changeSet.removedContacts().isEmpty());
#ifdef NEW_QTPIM
QList<QContactId> changedIds;
Q_FOREACH(const auto &pair, changeSet.changedContacts()) {
changedIds.append(pair.second);
}
QVERIFY(changedIds.contains(id));
#else
QVERIFY(changeSet.changedContacts().contains(id));
#endif
changeSet.clearChangedContacts();
QVERIFY(changeSet.changedContacts().isEmpty());
......@@ -3173,13 +3202,18 @@ void tst_QContactManager::changeSet()
changeSet.removedRelationshipsContacts().insert(id);
changeSet.emitSignals(0);
changeSet.setOldAndNewSelfContactId(QPair<QContactId, QContactId>(QContactId(0), id));
#ifdef NEW_QTPIM
QContactId nullId;
#else
QContactId nullId(0);
#endif
changeSet.setOldAndNewSelfContactId(QPair<QContactId, QContactId>(nullId, id));
changeSet2 = changeSet;
QVERIFY(changeSet2.addedRelationshipsContacts() == changeSet.addedRelationshipsContacts());
QVERIFY(changeSet2.removedRelationshipsContacts() == changeSet.removedRelationshipsContacts());
QVERIFY(changeSet2.oldAndNewSelfContactId() == changeSet.oldAndNewSelfContactId());
changeSet.emitSignals(0);
changeSet.setOldAndNewSelfContactId(QPair<QContactId, QContactId>(id, QContactId(0)));
changeSet.setOldAndNewSelfContactId(QPair<QContactId, QContactId>(id, nullId));
QVERIFY(changeSet2.oldAndNewSelfContactId() != changeSet.oldAndNewSelfContactId());
changeSet.setDataChanged(true);
changeSet.emitSignals(0);
......@@ -3902,7 +3936,7 @@ void tst_QContactManager::familyDetail()
QCOMPARE(a.relatedContacts(QContactRelationship::Aggregates(), QContactRelationship::First).count(), 1);
QContactId aa(a.relatedContacts(QContactRelationship::Aggregates(), QContactRelationship::First).first().id());
QContactId aa(relatedContactId(a.relatedContacts(QContactRelationship::Aggregates(), QContactRelationship::First).first()));
QVERIFY(!aa.isNull());
QContactDetailFilter familyFilter;
......@@ -3962,7 +3996,7 @@ void tst_QContactManager::geoLocationDetail()