aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/e-mail-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libemail-engine/e-mail-utils.c')
-rw-r--r--libemail-engine/e-mail-utils.c104
1 files changed, 0 insertions, 104 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,