From 704b78d23bf8d707707411608a3453250f2637a1 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 6 Nov 2012 16:20:46 +0100 Subject: Replace deprecated GLib symbols (as of GLib 2.34.x) --- mail/e-mail-autoconfig.c | 6 ++++-- mail/importers/elm-importer.c | 14 +++++++------- mail/importers/evolution-mbox-importer.c | 14 +++++++------- mail/importers/pine-importer.c | 14 +++++++------- mail/mail-send-recv.c | 14 +++++++------- mail/message-list.c | 20 ++++++++++---------- mail/message-list.h | 2 +- 7 files changed, 43 insertions(+), 41 deletions(-) (limited to 'mail') diff --git a/mail/e-mail-autoconfig.c b/mail/e-mail-autoconfig.c index 65d735394a..5fa0fe23a6 100644 --- a/mail/e-mail-autoconfig.c +++ b/mail/e-mail-autoconfig.c @@ -289,14 +289,16 @@ mail_autoconfig_resolve_authority (const gchar *domain, * So use a reference count on the thread closure and always * let the thread run to completion even if we're not around * any longer to pick up the result. */ - resolver_thread = g_thread_create ( + resolver_thread = g_thread_try_new (NULL, mail_autoconfig_resolver_thread, resolver_closure_ref (closure), - FALSE /* not joinable */, error); + error); if (resolver_thread == NULL) return FALSE; + g_thread_unref (resolver_thread); + if (G_IS_CANCELLABLE (cancellable)) cancel_id = g_cancellable_connect ( cancellable, diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 5b555cb1c7..02d29f5394 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -51,7 +51,7 @@ struct _elm_import_msg { EImport *import; EImportTargetHome *target; - GMutex *status_lock; + GMutex status_lock; gchar *status_what; gint status_pc; gint status_timeout_id; @@ -228,7 +228,7 @@ elm_import_free (struct _elm_import_msg *m) g_object_unref (m->status); g_free (m->status_what); - g_mutex_free (m->status_lock); + g_mutex_clear (&m->status_lock); g_source_remove (m->status_timeout_id); m->status_timeout_id = 0; @@ -244,11 +244,11 @@ elm_status (CamelOperation *op, { struct _elm_import_msg *importer = data; - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); g_free (importer->status_what); importer->status_what = g_strdup (what); importer->status_pc = pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); } static gboolean @@ -259,11 +259,11 @@ elm_status_timeout (gpointer data) gchar *what; if (importer->status_what) { - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); what = importer->status_what; importer->status_what = NULL; pc = importer->status_pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); e_import_status ( importer->import, (EImportTarget *) @@ -294,7 +294,7 @@ mail_importer_elm_import (EImport *ei, g_object_ref (m->import); m->target = (EImportTargetHome *) target; m->status_timeout_id = g_timeout_add (100, elm_status_timeout, m); - m->status_lock = g_mutex_new (); + g_mutex_init (&m->status_lock); m->status = camel_operation_new (); g_signal_connect ( diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index a024729bc2..0f1e507f2c 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -59,7 +59,7 @@ typedef struct { EImport *import; EImportTarget *target; - GMutex *status_lock; + GMutex status_lock; gchar *status_what; gint status_pc; gint status_timeout_id; @@ -207,11 +207,11 @@ mbox_status (CamelOperation *op, { MboxImporter *importer = data; - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); g_free (importer->status_what); importer->status_what = g_strdup (what); importer->status_pc = pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); } static gboolean @@ -222,11 +222,11 @@ mbox_status_timeout (gpointer data) gchar *what; if (importer->status_what) { - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); what = importer->status_what; importer->status_what = NULL; pc = importer->status_pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); e_import_status ( importer->import, (EImportTarget *) @@ -244,7 +244,7 @@ mbox_import_done (gpointer data, g_source_remove (importer->status_timeout_id); g_free (importer->status_what); - g_mutex_free (importer->status_lock); + g_mutex_clear (&importer->status_lock); g_object_unref (importer->cancellable); e_import_complete (importer->import, importer->target); @@ -275,7 +275,7 @@ mbox_import (EImport *ei, g_datalist_set_data (&target->data, "mbox-data", importer); importer->import = ei; importer->target = target; - importer->status_lock = g_mutex_new (); + g_mutex_init (&importer->status_lock); importer->status_timeout_id = g_timeout_add (100, mbox_status_timeout, importer); importer->cancellable = camel_operation_new (); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index 664a77bcba..c8904c4e0b 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -53,7 +53,7 @@ struct _pine_import_msg { EImport *import; EImportTarget *target; - GMutex *status_lock; + GMutex status_lock; gchar *status_what; gint status_pc; gint status_timeout_id; @@ -298,7 +298,7 @@ pine_import_free (struct _pine_import_msg *m) g_object_unref (m->cancellable); g_free (m->status_what); - g_mutex_free (m->status_lock); + g_mutex_clear (&m->status_lock); g_source_remove (m->status_timeout_id); m->status_timeout_id = 0; @@ -314,11 +314,11 @@ pine_status (CamelOperation *op, { struct _pine_import_msg *importer = data; - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); g_free (importer->status_what); importer->status_what = g_strdup (what); importer->status_pc = pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); } static gboolean @@ -328,11 +328,11 @@ pine_status_timeout (struct _pine_import_msg *importer) gchar *what; if (importer->status_what) { - g_mutex_lock (importer->status_lock); + g_mutex_lock (&importer->status_lock); what = importer->status_what; importer->status_what = NULL; pc = importer->status_pc; - g_mutex_unlock (importer->status_lock); + g_mutex_unlock (&importer->status_lock); e_import_status ( importer->import, (EImportTarget *) @@ -364,7 +364,7 @@ mail_importer_pine_import (EImport *ei, m->target = target; m->status_timeout_id = g_timeout_add ( 100, (GSourceFunc) pine_status_timeout, m); - m->status_lock = g_mutex_new (); + g_mutex_init (&m->status_lock); m->cancellable = camel_operation_new (); g_signal_connect ( diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 3bbb8160a5..baeea6e10b 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -88,7 +88,7 @@ struct _send_data { CamelFolder *inbox; time_t inbox_update; - GMutex *lock; + GMutex lock; GHashTable *folders; GHashTable *active; /* send_info's by uri */ @@ -173,7 +173,7 @@ setup_send_data (EMailSession *session) if (send_data == NULL) { send_data = data = g_malloc0 (sizeof (*data)); - data->lock = g_mutex_new (); + g_mutex_init (&data->lock); data->folders = g_hash_table_new_full ( g_str_hash, g_str_equal, (GDestroyNotify) NULL, @@ -223,7 +223,7 @@ free_send_data (void) g_list_free (data->infos); g_hash_table_destroy (data->active); g_hash_table_destroy (data->folders); - g_mutex_free (data->lock); + g_mutex_clear (&data->lock); g_free (data); send_data = NULL; } @@ -937,9 +937,9 @@ receive_get_folder (CamelFilterDriver *d, struct _folder_info *oldinfo; gpointer oldkey, oldinfoptr; - g_mutex_lock (info->data->lock); + g_mutex_lock (&info->data->lock); oldinfo = g_hash_table_lookup (info->data->folders, uri); - g_mutex_unlock (info->data->lock); + g_mutex_unlock (&info->data->lock); if (oldinfo) { g_object_ref (oldinfo->folder); @@ -954,7 +954,7 @@ receive_get_folder (CamelFilterDriver *d, /* we recheck that the folder hasn't snuck in while we were loading it... */ /* and we assume the newer one is the same, but unref the old one anyway */ - g_mutex_lock (info->data->lock); + g_mutex_lock (&info->data->lock); if (g_hash_table_lookup_extended ( info->data->folders, uri, &oldkey, &oldinfoptr)) { @@ -970,7 +970,7 @@ receive_get_folder (CamelFilterDriver *d, g_object_ref (folder); - g_mutex_unlock (info->data->lock); + g_mutex_unlock (&info->data->lock); return folder; } diff --git a/mail/message-list.c b/mail/message-list.c index da0be14fea..959193a653 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2578,7 +2578,7 @@ message_list_init (MessageList *message_list) message_list->cursor_uid = NULL; message_list->last_sel_single = FALSE; - message_list->regen_lock = g_mutex_new (); + g_mutex_init (&message_list->regen_lock); /* TODO: Should this only get the selection if we're realised? */ p = message_list->priv; @@ -2747,7 +2747,7 @@ message_list_finalize (GObject *object) g_free (message_list->frozen_search); g_free (message_list->cursor_uid); - g_mutex_free (message_list->regen_lock); + g_mutex_clear (&message_list->regen_lock); clear_selection (message_list, &priv->clipboard); @@ -4833,9 +4833,9 @@ regen_list_done (struct _regen_list_msg *m) } else build_flat (m->ml, m->summary, m->changes); - g_mutex_lock (m->ml->regen_lock); + g_mutex_lock (&m->ml->regen_lock); m->ml->regen = g_list_remove (m->ml->regen, m); - g_mutex_unlock (m->ml->regen_lock); + g_mutex_unlock (&m->ml->regen_lock); if (m->ml->regen == NULL && m->ml->pending_select_uid) { gchar *uid; @@ -4904,9 +4904,9 @@ regen_list_free (struct _regen_list_msg *m) camel_folder_change_info_free (m->changes); /* we have to poke this here as well since we might've been cancelled and regened wont get called */ - g_mutex_lock (m->ml->regen_lock); + g_mutex_lock (&m->ml->regen_lock); m->ml->regen = g_list_remove (m->ml->regen, m); - g_mutex_unlock (m->ml->regen_lock); + g_mutex_unlock (&m->ml->regen_lock); if (m->expand_state) xmlFreeDoc (m->expand_state); @@ -4925,9 +4925,9 @@ static MailMsgInfo regen_list_info = { static gboolean ml_regen_timeout (struct _regen_list_msg *m) { - g_mutex_lock (m->ml->regen_lock); + g_mutex_lock (&m->ml->regen_lock); m->ml->regen = g_list_prepend (m->ml->regen, m); - g_mutex_unlock (m->ml->regen_lock); + g_mutex_unlock (&m->ml->regen_lock); /* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */ mail_msg_fast_ordered_push (m); @@ -4944,7 +4944,7 @@ mail_regen_cancel (MessageList *ml) if (ml->regen) { GList *link; - g_mutex_lock (ml->regen_lock); + g_mutex_lock (&ml->regen_lock); for (link = ml->regen; link != NULL; link = link->next) { MailMsg *mm = link->data; @@ -4954,7 +4954,7 @@ mail_regen_cancel (MessageList *ml) g_cancellable_cancel (cancellable); } - g_mutex_unlock (ml->regen_lock); + g_mutex_unlock (&ml->regen_lock); } /* including unqueued ones */ diff --git a/mail/message-list.h b/mail/message-list.h index 44a312e667..9c93c46b05 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -148,7 +148,7 @@ struct _MessageList { /* list of outstanding regeneration requests */ GList *regen; - GMutex *regen_lock; /* when writing to the regen, guard with this lock too */ + GMutex regen_lock; /* when writing to the regen, guard with this lock too */ gchar *pending_select_uid; /* set if we were busy regnerating * while we had a select come in */ gboolean pending_select_fallback; -- cgit v1.2.3