aboutsummaryrefslogtreecommitdiffstats
path: root/modules/cal-config-weather
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-06-18 21:34:33 +0800
committerMilan Crha <mcrha@redhat.com>2012-06-18 21:35:44 +0800
commit6c05b09be16ac8eceb17653c3c26c0c6f963ef10 (patch)
tree5bb22771cf05419f851373ee43b1ad39a0dcfeaa /modules/cal-config-weather
parente045e6f12324e1063a87488ac298fd23affea581 (diff)
downloadgsoc2013-evolution-6c05b09be16ac8eceb17653c3c26c0c6f963ef10.tar.gz
gsoc2013-evolution-6c05b09be16ac8eceb17653c3c26c0c6f963ef10.tar.zst
gsoc2013-evolution-6c05b09be16ac8eceb17653c3c26c0c6f963ef10.zip
Do not call g_object_notify() when property didn't change
Diffstat (limited to 'modules/cal-config-weather')
-rw-r--r--modules/cal-config-weather/e-source-weather.c14
1 files changed, 13 insertions, 1 deletions
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");