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 --- libevolution-utils/e-alert.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libevolution-utils') diff --git a/libevolution-utils/e-alert.c b/libevolution-utils/e-alert.c index 7983083103..7d3b5e717f 100644 --- a/libevolution-utils/e-alert.c +++ b/libevolution-utils/e-alert.c @@ -782,6 +782,9 @@ e_alert_set_message_type (EAlert *alert, { g_return_if_fail (E_IS_ALERT (alert)); + if (alert->priv->message_type == message_type) + return; + alert->priv->message_type = message_type; g_object_notify (G_OBJECT (alert), "message-type"); @@ -818,6 +821,9 @@ e_alert_set_primary_text (EAlert *alert, { g_return_if_fail (E_IS_ALERT (alert)); + if (g_strcmp0 (alert->priv->primary_text, primary_text) == 0) + return; + g_free (alert->priv->primary_text); alert->priv->primary_text = g_strdup (primary_text); @@ -855,6 +861,9 @@ e_alert_set_secondary_text (EAlert *alert, { g_return_if_fail (E_IS_ALERT (alert)); + if (g_strcmp0 (alert->priv->secondary_text, secondary_text) == 0) + return; + g_free (alert->priv->secondary_text); alert->priv->secondary_text = g_strdup (secondary_text); -- cgit v1.2.3