summaryrefslogtreecommitdiffstats
path: root/src/contacts/qcontactmanagerengine.h
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-05-13 21:47:16 +0300
committerMatthew Vogt <matthew.vogt@qinetic.com.au>2014-08-01 02:59:05 +0200
commit39f686ed2492dd168eb551f96a22b08b2eedeb45 (patch)
treec8e97260485272a927348de2a20b39882a4a348f /src/contacts/qcontactmanagerengine.h
parent3b77fe17a82590627d306d5e58ecd5d83fee7893 (diff)
Simplify contact and organizer ID representations
Simplify contact and organizer IDs to simply contain a manager URI that identifies the owner of the identified object, and an engine- specific string that identifies the object to that manager. Change-Id: Ic14c419df264e91c61e0f3d474d846289e1aaa82 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/contacts/qcontactmanagerengine.h')
-rw-r--r--src/contacts/qcontactmanagerengine.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/contacts/qcontactmanagerengine.h b/src/contacts/qcontactmanagerengine.h
index fc267c812..c6bde2774 100644
--- a/src/contacts/qcontactmanagerengine.h
+++ b/src/contacts/qcontactmanagerengine.h
@@ -67,12 +67,16 @@ public:
QContactManagerEngine() {}
/* URI reporting */
- virtual QString managerName() const = 0; // e.g. "memory"
- virtual QMap<QString, QString> managerParameters() const; // e.g. "filename=private.db"
+ virtual QString managerName() const = 0; // e.g. "memory"
+ virtual QMap<QString, QString> managerParameters() const; // e.g. "filename=private.db,cachesize=1024"
+ virtual QMap<QString, QString> idInterpretationParameters() const; // e.g. "filename=private.db"
virtual int managerVersion() const = 0;
- /* Default and only implementation of this */
- QString managerUri() const;
+ inline QString managerUri() const
+ { return QContactManager::buildUri(managerName(), idInterpretationParameters()); }
+
+ inline QContactId contactId(const QString &localId) const
+ { return QContactId(managerUri(), localId); }
/* Filtering */
virtual QList<QContactId> contactIds(const QContactFilter &filter, const QList<QContactSortOrder> &sortOrders, QContactManager::Error *error) const;
@@ -141,7 +145,6 @@ public:
static void setContactRelationships(QContact *contact, const QList<QContactRelationship> &relationships);
/* Helper functions */
- static const QContactEngineId *engineId(const QContactId &contactId);
static int compareContact(const QContact &a, const QContact &b, const QList<QContactSortOrder> &sortOrders);
static void addSorted(QList<QContact>* sorted, const QContact &toAdd, const QList<QContactSortOrder> &sortOrders);
static int compareVariant(const QVariant &first, const QVariant &second, Qt::CaseSensitivity sensitivity);
@@ -150,7 +153,6 @@ public:
static QContactFilter canonicalizedFilter(const QContactFilter &filter);
-
private:
/* QContactChangeSet is a utility class used to emit the appropriate signals */
friend class QContactChangeSet;