mu: write contacts-cache a bit sooner

Write the changes to the cache file after any indexing operation, so `mu
cfind` gets new contacts a bit sooner.
This commit is contained in:
djcb
2016-02-21 19:48:21 +02:00
parent 2b0d75b295
commit 775eb3f715
5 changed files with 41 additions and 26 deletions

View File

@ -111,7 +111,7 @@ typedef void (*MuContactsForeachFunc) (const char *email, const char *name,
* call a function for either each contact, or each contact satisfying
* a regular expression,
*
* @param contacts contacts object
* @param self contacts object
* @param func callback function to be called for each
* @param user_data user data to pass to the callback
* @param pattern a regular expression which matches either the e-mail
@ -124,6 +124,15 @@ typedef void (*MuContactsForeachFunc) (const char *email, const char *name,
gboolean mu_contacts_foreach (MuContacts *self, MuContactsForeachFunc func,
gpointer user_data, const char* pattern, size_t *num);
/**
* serialize the contacts to the contacts cache file
*
* @param self contacts object
*
* @return TRUE if the function succeeded, FALSE otherwise
* */
gboolean mu_contacts_serialize (MuContacts *self);
G_END_DECLS
#endif /*__MU_CONTACTS_H__*/