Commit 621f652a authored by Andrew den Exter's avatar Andrew den Exter

Merge branch 'jb50910' into 'master'

[contacts] Allow contact listenters to specify required properties. Contributes to JB#50910

See merge request mer-core/libcontacts!20
parents d5f27cc0 ddc23704
......@@ -258,6 +258,9 @@ QContactFetchHint metadataFetchHint(quint32 fetchTypes = 0)
if (fetchTypes & SeasideCache::FetchOrganization) {
types << detailType<QContactOrganization>();
}
if (fetchTypes & SeasideCache::FetchAvatar) {
types << detailType<QContactAvatar>();
}
setDetailTypesHint(fetchHint, types);
return fetchHint;
......@@ -300,6 +303,9 @@ QContactFetchHint extendedMetadataFetchHint(quint32 fetchTypes)
if (fetchTypes & SeasideCache::FetchOrganization) {
types << detailType<QContactOrganization>();
}
if (fetchTypes & SeasideCache::FetchAvatar) {
types << detailType<QContactAvatar>();
}
setDetailTypesHint(fetchHint, types);
return fetchHint;
......@@ -707,6 +713,15 @@ void SeasideCache::registerChangeListener(ChangeListener *listener)
instancePtr->m_changeListeners.append(listener);
}
void SeasideCache::registerChangeListener(ChangeListener *listener, FetchDataType requiredTypes, FetchDataType extraTypes)
{
// Ensure the cache has been instantiated
instance();
instancePtr->m_changeListeners.append(listener);
instancePtr->keepPopulated(requiredTypes, extraTypes);
}
void SeasideCache::unregisterChangeListener(ChangeListener *listener)
{
if (!instancePtr)
......
......@@ -88,10 +88,12 @@ public:
FetchPhoneNumber = (1 << 1),
FetchEmailAddress = (1 << 2),
FetchOrganization = (1 << 3),
FetchAvatar = (1 << 4),
FetchTypesMask = (FetchAccountUri |
FetchPhoneNumber |
FetchEmailAddress |
FetchOrganization)
FetchOrganization |
FetchAvatar)
};
enum DisplayLabelOrder {
......@@ -291,6 +293,7 @@ public:
static void unregisterDisplayLabelGroupChangeListener(SeasideDisplayLabelGroupChangeListener *listener);
static void registerChangeListener(ChangeListener *listener);
static void registerChangeListener(ChangeListener *listener, FetchDataType requiredTypes, FetchDataType extraTypes = FetchNone);
static void unregisterChangeListener(ChangeListener *listener);
static void unregisterResolveListener(ResolveListener *listener);
......
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