From 6c05b09be16ac8eceb17653c3c26c0c6f963ef10 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 18 Jun 2012 15:34:33 +0200 Subject: Do not call g_object_notify() when property didn't change --- modules/cal-config-weather/e-source-weather.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'modules/cal-config-weather') diff --git a/modules/cal-config-weather/e-source-weather.c b/modules/cal-config-weather/e-source-weather.c index 63db1bc14b..3440224173 100644 --- a/modules/cal-config-weather/e-source-weather.c +++ b/modules/cal-config-weather/e-source-weather.c @@ -212,12 +212,21 @@ void e_source_weather_set_location (ESourceWeather *extension, const gchar *location) { + gchar *new_location; + g_return_if_fail (E_IS_SOURCE_WEATHER (extension)); 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_free (new_location); + return; + } + g_free (extension->priv->location); - extension->priv->location = e_util_strdup_strip (location); + extension->priv->location = new_location; g_mutex_unlock (extension->priv->property_lock); @@ -238,6 +247,9 @@ e_source_weather_set_units (ESourceWeather *extension, { g_return_if_fail (E_IS_SOURCE_WEATHER (extension)); + if (extension->priv->units == units) + return; + extension->priv->units = units; g_object_notify (G_OBJECT (extension), "units"); -- cgit v1.2.3