Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[libcontacts] Provide function to refresh contact details from backend
  • Loading branch information
matthewvogt committed Aug 19, 2013
1 parent 2aec0bc commit 4d7ccc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/seasidecache.cpp
Expand Up @@ -687,12 +687,17 @@ QContact SeasideCache::contactById(const ContactIdType &id)
void SeasideCache::ensureCompletion(CacheItem *cacheItem)
{
if (cacheItem->contactState < ContactRequested) {
cacheItem->contactState = ContactRequested;
instancePtr->m_changedContacts.append(cacheItem->apiId());
instancePtr->fetchContacts();
refreshContact(cacheItem);
}
}

void SeasideCache::refreshContact(CacheItem *cacheItem)
{
cacheItem->contactState = ContactRequested;
instancePtr->m_changedContacts.append(cacheItem->apiId());
instancePtr->fetchContacts();
}

SeasideCache::CacheItem *SeasideCache::itemByPhoneNumber(const QString &number, bool requireComplete)
{
QString normalizedNumber = Normalization::normalizePhoneNumber(number);
Expand Down
1 change: 1 addition & 0 deletions src/seasidecache.h
Expand Up @@ -302,6 +302,7 @@ class CONTACTCACHE_EXPORT SeasideCache : public QObject
static QContact contactById(const ContactIdType &id);

static void ensureCompletion(CacheItem *cacheItem);
static void refreshContact(CacheItem *cacheItem);

static QChar nameGroup(const CacheItem *cacheItem);
static QChar determineNameGroup(const CacheItem *cacheItem);
Expand Down

0 comments on commit 4d7ccc7

Please sign in to comment.