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) --- modules/book-config-ldap/e-source-ldap.c | 26 +++++++++++++------------- modules/cal-config-local/e-source-local.c | 14 +++++++------- modules/cal-config-weather/e-source-weather.c | 16 ++++++++-------- modules/spamassassin/evolution-spamassassin.c | 22 +++++++++++----------- 4 files changed, 39 insertions(+), 39 deletions(-) (limited to 'modules') diff --git a/modules/book-config-ldap/e-source-ldap.c b/modules/book-config-ldap/e-source-ldap.c index 18bb104498..42d8a08eab 100644 --- a/modules/book-config-ldap/e-source-ldap.c +++ b/modules/book-config-ldap/e-source-ldap.c @@ -25,7 +25,7 @@ ((obj), E_TYPE_SOURCE_LDAP, ESourceLDAPPrivate)) struct _ESourceLDAPPrivate { - GMutex *property_lock; + GMutex property_lock; gboolean can_browse; gchar *filter; guint limit; @@ -225,7 +225,7 @@ source_ldap_finalize (GObject *object) priv = E_SOURCE_LDAP_GET_PRIVATE (object); - g_mutex_free (priv->property_lock); + g_mutex_clear (&priv->property_lock); g_free (priv->filter); g_free (priv->root_dn); @@ -386,7 +386,7 @@ static void e_source_ldap_init (ESourceLDAP *extension) { extension->priv = E_SOURCE_LDAP_GET_PRIVATE (extension); - extension->priv->property_lock = g_mutex_new (); + g_mutex_init (&extension->priv->property_lock); } void @@ -509,12 +509,12 @@ e_source_ldap_dup_filter (ESourceLDAP *extension) g_return_val_if_fail (E_IS_SOURCE_LDAP (extension), NULL); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); protected = e_source_ldap_get_filter (extension); duplicate = g_strdup (protected); - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); return duplicate; } @@ -533,7 +533,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension, !g_str_has_prefix (filter, "(") && !g_str_has_suffix (filter, ")"); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); if (needs_parens) new_filter = g_strdup_printf ("(%s)", filter); @@ -541,7 +541,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension, new_filter = g_strdup (filter); if (g_strcmp0 (extension->priv->filter, new_filter) == 0) { - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_free (new_filter); return; } @@ -549,7 +549,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension, g_free (extension->priv->filter); extension->priv->filter = new_filter; - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_object_notify (G_OBJECT (extension), "filter"); } @@ -592,12 +592,12 @@ e_source_ldap_dup_root_dn (ESourceLDAP *extension) g_return_val_if_fail (E_IS_SOURCE_LDAP (extension), NULL); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); protected = e_source_ldap_get_root_dn (extension); duplicate = g_strdup (protected); - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); return duplicate; } @@ -608,17 +608,17 @@ e_source_ldap_set_root_dn (ESourceLDAP *extension, { g_return_if_fail (E_IS_SOURCE_LDAP (extension)); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); if (g_strcmp0 (extension->priv->root_dn, root_dn) == 0) { - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); return; } g_free (extension->priv->root_dn); extension->priv->root_dn = e_util_strdup_strip (root_dn); - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_object_notify (G_OBJECT (extension), "root-dn"); } diff --git a/modules/cal-config-local/e-source-local.c b/modules/cal-config-local/e-source-local.c index 6877cf0d27..10b737a858 100644 --- a/modules/cal-config-local/e-source-local.c +++ b/modules/cal-config-local/e-source-local.c @@ -23,7 +23,7 @@ ((obj), E_TYPE_SOURCE_LOCAL, ESourceLocalPrivate)) struct _ESourceLocalPrivate { - GMutex *property_lock; + GMutex property_lock; GFile *custom_file; }; @@ -95,7 +95,7 @@ source_local_finalize (GObject *object) priv = E_SOURCE_LOCAL_GET_PRIVATE (object); - g_mutex_free (priv->property_lock); + g_mutex_clear (&priv->property_lock); /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_source_local_parent_class)->finalize (object); @@ -140,7 +140,7 @@ static void e_source_local_init (ESourceLocal *extension) { extension->priv = E_SOURCE_LOCAL_GET_PRIVATE (extension); - extension->priv->property_lock = g_mutex_new (); + g_mutex_init (&extension->priv->property_lock); } void @@ -168,12 +168,12 @@ e_source_local_dup_custom_file (ESourceLocal *extension) g_return_val_if_fail (E_IS_SOURCE_LOCAL (extension), NULL); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); protected = e_source_local_get_custom_file (extension); duplicate = (protected != NULL) ? g_file_dup (protected) : NULL; - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); return duplicate; } @@ -189,14 +189,14 @@ e_source_local_set_custom_file (ESourceLocal *extension, g_object_ref (custom_file); } - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); if (extension->priv->custom_file != NULL) g_object_unref (extension->priv->custom_file); extension->priv->custom_file = custom_file; - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_object_notify (G_OBJECT (extension), "custom-file"); } diff --git a/modules/cal-config-weather/e-source-weather.c b/modules/cal-config-weather/e-source-weather.c index 3440224173..4ba306408a 100644 --- a/modules/cal-config-weather/e-source-weather.c +++ b/modules/cal-config-weather/e-source-weather.c @@ -23,7 +23,7 @@ ((obj), E_TYPE_SOURCE_WEATHER, ESourceWeatherPrivate)) struct _ESourceWeatherPrivate { - GMutex *property_lock; + GMutex property_lock; ESourceWeatherUnits units; gchar *location; }; @@ -96,7 +96,7 @@ source_weather_finalize (GObject *object) priv = E_SOURCE_WEATHER_GET_PRIVATE (object); - g_mutex_free (priv->property_lock); + g_mutex_clear (&priv->property_lock); g_free (priv->location); @@ -155,7 +155,7 @@ static void e_source_weather_init (ESourceWeather *extension) { extension->priv = E_SOURCE_WEATHER_GET_PRIVATE (extension); - extension->priv->property_lock = g_mutex_new (); + g_mutex_init (&extension->priv->property_lock); } void @@ -198,12 +198,12 @@ e_source_weather_dup_location (ESourceWeather *extension) g_return_val_if_fail (E_IS_SOURCE_WEATHER (extension), NULL); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); protected = e_source_weather_get_location (extension); duplicate = g_strdup (protected); - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); return duplicate; } @@ -216,11 +216,11 @@ e_source_weather_set_location (ESourceWeather *extension, g_return_if_fail (E_IS_SOURCE_WEATHER (extension)); - g_mutex_lock (extension->priv->property_lock); + g_mutex_lock (&extension->priv->property_lock); new_location = e_util_strdup_strip (location); if (g_strcmp0 (extension->priv->location, new_location) == 0) { - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_free (new_location); return; } @@ -228,7 +228,7 @@ e_source_weather_set_location (ESourceWeather *extension, g_free (extension->priv->location); extension->priv->location = new_location; - g_mutex_unlock (extension->priv->property_lock); + g_mutex_unlock (&extension->priv->property_lock); g_object_notify (G_OBJECT (extension), "location"); } diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index 480fedccd4..6a8affab83 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -63,7 +63,7 @@ struct _ESpamAssassin { EMailJunkFilter parent; GOnce spamd_testing; - GMutex *socket_path_mutex; + GMutex socket_path_mutex; gchar *pid_file; gchar *socket_path; @@ -412,7 +412,7 @@ spam_assassin_test_spamd_running (ESpamAssassin *extension, gint ii = 0; GError *error = NULL; - g_mutex_lock (extension->socket_path_mutex); + g_mutex_lock (&extension->socket_path_mutex); argv[ii++] = SPAMC_COMMAND; argv[ii++] = "--no-safe-fallback"; @@ -432,7 +432,7 @@ spam_assassin_test_spamd_running (ESpamAssassin *extension, g_error_free (error); } - g_mutex_unlock (extension->socket_path_mutex); + g_mutex_unlock (&extension->socket_path_mutex); return (exit_code == 0); } @@ -444,12 +444,12 @@ spam_assassin_kill_our_own_daemon (ESpamAssassin *extension) gchar *contents = NULL; GError *error = NULL; - g_mutex_lock (extension->socket_path_mutex); + g_mutex_lock (&extension->socket_path_mutex); g_free (extension->socket_path); extension->socket_path = NULL; - g_mutex_unlock (extension->socket_path_mutex); + g_mutex_unlock (&extension->socket_path_mutex); if (extension->pid_file == NULL) return; @@ -493,7 +493,7 @@ spam_assassin_start_our_own_daemon (ESpamAssassin *extension) gint fd; GError *error = NULL; - g_mutex_lock (extension->socket_path_mutex); + g_mutex_lock (&extension->socket_path_mutex); /* Don't put the PID files in Evolution's tmp directory * (as defined in e-mktemp.c) because that gets cleaned @@ -588,7 +588,7 @@ exit: g_free (pid_file); g_free (socket_path); - g_mutex_unlock (extension->socket_path_mutex); + g_mutex_unlock (&extension->socket_path_mutex); return started; } @@ -725,7 +725,7 @@ spam_assassin_finalize (GObject *object) { ESpamAssassin *extension = E_SPAM_ASSASSIN (object); - g_mutex_free (extension->socket_path_mutex); + g_mutex_clear (&extension->socket_path_mutex); g_free (extension->pid_file); g_free (extension->socket_path); @@ -809,7 +809,7 @@ spam_assassin_classify (CamelJunkFilter *junk_filter, if (g_cancellable_set_error_if_cancelled (cancellable, error)) return FALSE; - g_mutex_lock (extension->socket_path_mutex); + g_mutex_lock (&extension->socket_path_mutex); if (extension->use_spamc) { g_assert (SPAMC_COMMAND != NULL); @@ -860,7 +860,7 @@ spam_assassin_classify (CamelJunkFilter *junk_filter, else g_warn_if_fail (error == NULL || *error != NULL); - g_mutex_unlock (extension->socket_path_mutex); + g_mutex_unlock (&extension->socket_path_mutex); return status; } @@ -1084,7 +1084,7 @@ e_spam_assassin_init (ESpamAssassin *extension) { GSettings *settings; - extension->socket_path_mutex = g_mutex_new (); + g_mutex_init (&extension->socket_path_mutex); settings = g_settings_new ("org.gnome.evolution.spamassassin"); -- cgit