Commit 430ad0d5 authored by chriadam's avatar chriadam

[buteo-sync-plugin-carddav] Relax our comparison strictness during delta...

[buteo-sync-plugin-carddav] Relax our comparison strictness during delta detection. Contributes to MER#1379

This commit ensures that we disregard X-GENDER properties and also
ADR property TYPE parameters during delta detection.

The X-GENDER property is required by our backend and therefore will
always exist locally even if we don't upsync it, thus should not be
considered in the delta.
The ADR property's TYPE parameter is also handled specially by our
backend and can be removed from the delta comparison.

Contributes to MER#1379
parent 0bd348a8
......@@ -40,6 +40,10 @@
#include <QtContacts/QContactManager>
#include <QtContacts/QContactGuid>
#include <QtContacts/QContactSyncTarget>
#include <QtContacts/QContactPhoneNumber>
#include <QtContacts/QContactAvatar>
#include <QtContacts/QContactAddress>
#include <QtContacts/QContactUrl>
#include <QtContacts/QContactDetailFilter>
#include <QtContacts/QContactIntersectionFilter>
#include <QtContacts/QContactSyncTarget>
......@@ -175,9 +179,11 @@ void Syncer::continueSync(const QList<QContact> &added, const QList<QContact> &m
// in-memory version (QContact) and the exportable version (vCard) resulting in ETag updates server-side.
// The downside is that changes to these details will not be upsynced unless another change also occurs.
QSet<QContactDetail::DetailType> ignorableDetailTypes = getDefaultIgnorableDetailTypes();
ignorableDetailTypes.insert(QContactDetail::TypeGender); // ignore differences in X-GENDER field when detecting delta.
ignorableDetailTypes.insert(QContactDetail::TypeFavorite); // ignore differences in X-FAVORITE field when detecting delta.
ignorableDetailTypes.insert(QContactDetail::TypeAvatar); // ignore differences in PHOTO field when detecting delta.
QHash<QContactDetail::DetailType, QSet<int> > ignorableDetailFields = getDefaultIgnorableDetailFields();
ignorableDetailFields[QContactDetail::TypeAddress] << QContactAddress::FieldSubTypes; // and ADR subtypes
ignorableDetailFields[QContactDetail::TypePhoneNumber] << QContactPhoneNumber::FieldSubTypes; // and TEL number subtypes
ignorableDetailFields[QContactDetail::TypeUrl] << QContactUrl::FieldSubType; // and URL subtype
if (!determineLocalChanges(&localSince, &locallyAdded, &locallyModified, &locallyDeleted,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment