aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-27 07:36:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-27 23:59:55 +0800
commit4a06e1bb633e392b049942ef28360d3830e78420 (patch)
tree6feec76d0ba79a9e1f75b7d4892ec839492a6fce /libemail-engine
parent667585134e2b248e3d93f2f55cdee86b71e5432f (diff)
downloadgsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar.gz
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar.bz2
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar.lz
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar.xz
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.tar.zst
gsoc2013-evolution-4a06e1bb633e392b049942ef28360d3830e78420.zip
Remove emu_free_mail_cache().
No longer needed, since the resources it frees are no longer used.
Diffstat (limited to 'libemail-engine')
-rw-r--r--libemail-engine/e-mail-utils.c104
-rw-r--r--libemail-engine/e-mail-utils.h2
2 files changed, 0 insertions, 106 deletions
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index 74aecf19ec..21d53b65a3 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -608,110 +608,6 @@ em_utils_in_addressbook (ESourceRegistry *registry,
registry, addr, local_only, NULL, NULL, cancellable);
}
-typedef struct _PhotoInfo {
- gchar *address;
- EContactPhoto *photo;
-} PhotoInfo;
-
-static void
-emu_free_photo_info (PhotoInfo *pi)
-{
- if (!pi)
- return;
-
- if (pi->address)
- g_free (pi->address);
- if (pi->photo)
- e_contact_photo_free (pi->photo);
- g_free (pi);
-}
-
-static ECancellableMutex photos_cache_lock;
-static GSList *photos_cache = NULL; /* list of PhotoInfo-s */
-
-struct FreeMailCacheData
-{
- GDestroyNotify done_cb;
- gpointer user_data;
-};
-
-static gboolean
-free_mail_cache_idle (gpointer user_data)
-{
- struct FreeMailCacheData *fmc = user_data;
-
- g_return_val_if_fail (fmc != NULL, FALSE);
-
- if (fmc->done_cb)
- fmc->done_cb (fmc->user_data);
- g_free (fmc);
-
- return FALSE;
-}
-
-static gpointer
-free_mail_cache_thread (gpointer user_data)
-{
- g_return_val_if_fail (user_data != NULL, NULL);
-
- if (e_cancellable_mutex_lock (&contact_cache_lock, NULL)) {
- if (emu_books_hash) {
- g_hash_table_destroy (emu_books_hash);
- emu_books_hash = NULL;
- }
-
- if (emu_broken_books_hash) {
- g_hash_table_destroy (emu_broken_books_hash);
- emu_broken_books_hash = NULL;
- }
-
- if (contact_cache) {
- g_hash_table_destroy (contact_cache);
- contact_cache = NULL;
- }
-
- e_cancellable_mutex_unlock (&contact_cache_lock);
- }
-
- if (e_cancellable_mutex_lock (&photos_cache_lock, NULL)) {
- g_slist_foreach (photos_cache, (GFunc) emu_free_photo_info, NULL);
- g_slist_free (photos_cache);
- photos_cache = NULL;
-
- e_cancellable_mutex_unlock (&photos_cache_lock);
- }
-
- /* Prioritize ahead of GTK+ redraws. */
- g_idle_add_full (
- G_PRIORITY_HIGH_IDLE,
- free_mail_cache_idle, user_data, NULL);
-
- return NULL;
-}
-
-/* frees all data created by call of em_utils_in_addressbook() or
- * em_utils_contact_photo(); done_cb is called when freeing is done,
- * in an idle callback
- */
-void
-emu_free_mail_cache (GDestroyNotify done_cb,
- gpointer user_data)
-{
- struct FreeMailCacheData *fmc;
- GThread *thread;
-
- G_LOCK (search_addressbook_cancellables);
- g_slist_foreach (search_addressbook_cancellables, (GFunc) g_cancellable_cancel, NULL);
- G_UNLOCK (search_addressbook_cancellables);
-
- fmc = g_new0 (struct FreeMailCacheData, 1);
- fmc->done_cb = done_cb;
- fmc->user_data = user_data;
-
- thread = g_thread_new (NULL, free_mail_cache_thread, fmc);
- g_thread_unref (thread);
-}
-
static ESource *
guess_mail_account_from_folder (ESourceRegistry *registry,
CamelFolder *folder,
diff --git a/libemail-engine/e-mail-utils.h b/libemail-engine/e-mail-utils.h
index 20a5ee0512..95a6bc62ce 100644
--- a/libemail-engine/e-mail-utils.h
+++ b/libemail-engine/e-mail-utils.h
@@ -58,8 +58,6 @@ ESource * em_utils_guess_mail_identity_with_recipients
ESource * em_utils_ref_mail_identity_for_store
(ESourceRegistry *registry,
CamelStore *store);
-void emu_free_mail_cache (GDestroyNotify done_cb,
- gpointer user_data);
void em_utils_uids_free (GPtrArray *uids);
gboolean em_utils_is_local_delivery_mbox_file
(CamelURL *url);