[evolution-mapi] Do not call g_object_notify() when property didn't change



commit 239238c4c990ebef77903a7595d39b5ee0afcdd8
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 18 18:01:59 2012 +0200

    Do not call g_object_notify() when property didn't change

 src/libexchangemapi/camel-mapi-settings.c |   30 +++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/libexchangemapi/camel-mapi-settings.c b/src/libexchangemapi/camel-mapi-settings.c
index 4005ba3..6257117 100644
--- a/src/libexchangemapi/camel-mapi-settings.c
+++ b/src/libexchangemapi/camel-mapi-settings.c
@@ -429,6 +429,9 @@ camel_mapi_settings_set_check_all (CamelMapiSettings *settings,
 {
 	g_return_if_fail (CAMEL_IS_MAPI_SETTINGS (settings));
 
+	if ((settings->priv->check_all ? 1 : 0) == (check_all ? 1 : 0))
+		return;
+
 	settings->priv->check_all = check_all;
 
 	g_object_notify (G_OBJECT (settings), "check-all");
@@ -472,6 +475,11 @@ camel_mapi_settings_set_domain (CamelMapiSettings *settings,
 
 	g_mutex_lock (settings->priv->property_lock);
 
+	if (g_strcmp0 (settings->priv->domain, domain) == 0) {
+		g_mutex_unlock (settings->priv->property_lock);
+		return;
+	}
+
 	g_free (settings->priv->domain);
 	settings->priv->domain = g_strdup (domain);
 
@@ -494,6 +502,9 @@ camel_mapi_settings_set_filter_junk (CamelMapiSettings *settings,
 {
 	g_return_if_fail (CAMEL_IS_MAPI_SETTINGS (settings));
 
+	if ((settings->priv->filter_junk ? 1 : 0) == (filter_junk ? 1 : 0))
+		return;
+
 	settings->priv->filter_junk = filter_junk;
 
 	g_object_notify (G_OBJECT (settings), "filter-junk");
@@ -513,6 +524,9 @@ camel_mapi_settings_set_filter_junk_inbox (CamelMapiSettings *settings,
 {
 	g_return_if_fail (CAMEL_IS_MAPI_SETTINGS (settings));
 
+	if ((settings->priv->filter_junk_inbox ? 1 : 0) == (filter_junk_inbox ? 1 : 0))
+		return;
+
 	settings->priv->filter_junk_inbox = filter_junk_inbox;
 
 	g_object_notify (G_OBJECT (settings), "filter-junk-inbox");
@@ -532,6 +546,9 @@ camel_mapi_settings_set_kerberos (CamelMapiSettings *settings,
 {
 	g_return_if_fail (CAMEL_IS_MAPI_SETTINGS (settings));
 
+	if ((settings->priv->kerberos ? 1 : 0) == (kerberos ? 1 : 0))
+		return;
+
 	settings->priv->kerberos = kerberos;
 
 	g_object_notify (G_OBJECT (settings), "kerberos");
@@ -571,6 +588,11 @@ camel_mapi_settings_set_profile (CamelMapiSettings *settings,
 
 	g_mutex_lock (settings->priv->property_lock);
 
+	if (g_strcmp0 (settings->priv->profile, profile) == 0) {
+		g_mutex_unlock (settings->priv->property_lock);
+		return;
+	}
+
 	g_free (settings->priv->profile);
 	settings->priv->profile = g_strdup (profile);
 
@@ -617,6 +639,11 @@ camel_mapi_settings_set_realm (CamelMapiSettings *settings,
 
 	g_mutex_lock (settings->priv->property_lock);
 
+	if (g_strcmp0 (settings->priv->realm, realm) == 0) {
+		g_mutex_unlock (settings->priv->property_lock);
+		return;
+	}
+
 	g_free (settings->priv->realm);
 	settings->priv->realm = g_strdup (realm);
 
@@ -639,6 +666,9 @@ camel_mapi_settings_set_listen_notifications (CamelMapiSettings *settings,
 {
 	g_return_if_fail (CAMEL_IS_MAPI_SETTINGS (settings));
 
+	if ((settings->priv->listen_notifications ? 1 : 0) == (listen_notifications ? 1 : 0))
+		return;
+
 	settings->priv->listen_notifications = listen_notifications;
 
 	g_object_notify (G_OBJECT (settings), "listen-notifications");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]