summaryrefslogtreecommitdiffstats
path: root/src/contacts/qcontactmanagerengine.h
diff options
context:
space:
mode:
authorMatt Vogt <matthew.vogt@jollamobile.com>2014-08-01 11:50:09 +1000
committerMatthew Vogt <matthew.vogt@qinetic.com.au>2014-08-01 23:39:53 +0200
commit1501a8f9fa6782078aac91742c84f9c8eb528196 (patch)
tree9eadd310783afaf8664a69a952a9273ccbeb6a3d /src/contacts/qcontactmanagerengine.h
parent39f686ed2492dd168eb551f96a22b08b2eedeb45 (diff)
Cache managerUri value to promote string data sharing
Allow the various instances of string objects containing manager URIs to be shared, by returning a fixed instance from which they can be copied. Change-Id: Id2522c35a1aa009667348a61409cfd87837be9cf Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/contacts/qcontactmanagerengine.h')
-rw-r--r--src/contacts/qcontactmanagerengine.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/contacts/qcontactmanagerengine.h b/src/contacts/qcontactmanagerengine.h
index c6bde2774..6e993f8df 100644
--- a/src/contacts/qcontactmanagerengine.h
+++ b/src/contacts/qcontactmanagerengine.h
@@ -73,7 +73,7 @@ public:
virtual int managerVersion() const = 0;
inline QString managerUri() const
- { return QContactManager::buildUri(managerName(), idInterpretationParameters()); }
+ { if (m_uri.isNull()) m_uri = QContactManager::buildUri(managerName(), idInterpretationParameters()); return m_uri; }
inline QContactId contactId(const QString &localId) const
{ return QContactId(managerUri(), localId); }
@@ -156,6 +156,8 @@ public:
private:
/* QContactChangeSet is a utility class used to emit the appropriate signals */
friend class QContactChangeSet;
+
+ mutable QString m_uri;
};
QT_END_NAMESPACE_CONTACTS