• chriadam's avatar
    [qtcontacts-sqlite] Perform contact aggregation on save · c607e243
    chriadam authored
    This commit adds automatic contact linking (aggregation) support to
    the backend.  Contacts with a special sync target "aggregate" are
    created which contain all information from contacts which are about
    the same logical entity.  The "aggregate" contact has "Aggregates"
    relationships with all of those contacts.  These "aggregate" contacts
    are returned by default in all queries (unless a QContactDetailFilter
    with a SyncTarget criteria is explicitly set by the client).
    Whenever a new contact is created, the "aggregate" contacts are
    searched to find an existing, matching "aggregate".  If it exists, the
    newly added contact is included into that "aggregate" otherwise a new
    "aggregate" is created for it.
    This allows the data from different sources (sync services) to be kept
    entirely separate in the backend.
    Aggregation process:
       - return aggregate contacts by default if no sync target filter specified
       - create/update aggregate on create new contact
       - create/update local on update aggregate
       - regenerate aggregate on remove contact
       - remove all aggregated contacts on remove aggregate
qtcontacts-sqlite.pro 80 Bytes