Skip to content

Commit

Permalink
[libcommhistory] Use collection instead of syncTarget to filter aggre…
Browse files Browse the repository at this point in the history
…gates. JB#50658
  • Loading branch information
Bea Lam committed Sep 15, 2020
1 parent 6f52be8 commit 0f403af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions src/contactlistener.cpp
Expand Up @@ -31,7 +31,6 @@
#include <QContactOnlineAccount>
#include <QContactPhoneNumber>
#include <QContactEmailAddress>
#include <QContactSyncTarget>

#include "commonutils.h"
#include "contactresolver.h"
Expand Down Expand Up @@ -163,9 +162,7 @@ void ContactListenerPrivate::itemUpdated(SeasideCache::CacheItem *item)
Q_Q(ContactListener);

// Only aggregate contacts are relevant
static const QString aggregateTarget(QString::fromLatin1("aggregate"));
QContactSyncTarget syncTarget(item->contact.detail<QContactSyncTarget>());
if (syncTarget.syncTarget() != aggregateTarget)
if (item->contact.collectionId() != SeasideCache::aggregateCollectionId())
return;

// Make a list of Recipient from the contacts addresses to compare against
Expand Down
8 changes: 0 additions & 8 deletions tests/common.cpp
Expand Up @@ -41,7 +41,6 @@
#include <QContactNickname>
#include <QContactOnlineAccount>
#include <QContactPhoneNumber>
#include <QContactSyncTarget>

#include <QEventLoop>
#include <QFile>
Expand Down Expand Up @@ -88,13 +87,6 @@ QContact createTestContact(const QString &name, const QString &remoteUid, const
{
QContact contact;

QContactSyncTarget syncTarget;
syncTarget.setSyncTarget(QLatin1String("commhistory-tests"));
if (!contact.saveDetail(&syncTarget)) {
qWarning() << "Unable to add sync target to contact:" << contactUri;
return QContact();
}

if (!localUid.isEmpty() && !localUidComparesPhoneNumbers(localUid)) {
// Create a metadata detail to link the contact with the account
QContactOriginMetadata metadata;
Expand Down

0 comments on commit 0f403af

Please sign in to comment.