aboutsummaryrefslogtreecommitdiffstats
path: root/modules/book-config-ldap
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/book-config-ldap
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/book-config-ldap')
-rw-r--r--modules/book-config-ldap/e-source-ldap.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/modules/book-config-ldap/e-source-ldap.c b/modules/book-config-ldap/e-source-ldap.c
index 88ee6bc634..a491409029 100644
--- a/modules/book-config-ldap/e-source-ldap.c
+++ b/modules/book-config-ldap/e-source-ldap.c
@@ -463,6 +463,9 @@ e_source_ldap_set_authentication (ESourceLDAP *extension,
{
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
+ if (extension->priv->authentication == authentication)
+ return;
+
extension->priv->authentication = authentication;
g_object_notify (G_OBJECT (extension), "authentication");
@@ -482,6 +485,9 @@ e_source_ldap_set_can_browse (ESourceLDAP *extension,
{
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
+ if ((extension->priv->can_browse ? 1 : 0) == (can_browse ? 1 : 0))
+ return;
+
extension->priv->can_browse = can_browse;
g_object_notify (G_OBJECT (extension), "can-browse");
@@ -518,6 +524,7 @@ e_source_ldap_set_filter (ESourceLDAP *extension,
const gchar *filter)
{
gboolean needs_parens;
+ gchar *new_filter;
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
@@ -528,11 +535,19 @@ e_source_ldap_set_filter (ESourceLDAP *extension,
g_mutex_lock (extension->priv->property_lock);
- g_free (extension->priv->filter);
if (needs_parens)
- extension->priv->filter = g_strdup_printf ("(%s)", filter);
+ new_filter = g_strdup_printf ("(%s)", filter);
else
- extension->priv->filter = g_strdup (filter);
+ new_filter = g_strdup (filter);
+
+ if (g_strcmp0 (extension->priv->filter, new_filter) == 0) {
+ g_mutex_unlock (extension->priv->property_lock);
+ g_free (new_filter);
+ return;
+ }
+
+ g_free (extension->priv->filter);
+ extension->priv->filter = new_filter;
g_mutex_unlock (extension->priv->property_lock);
@@ -553,6 +568,9 @@ e_source_ldap_set_limit (ESourceLDAP *extension,
{
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
+ if (extension->priv->limit == limit)
+ return;
+
extension->priv->limit = limit;
g_object_notify (G_OBJECT (extension), "limit");
@@ -592,6 +610,11 @@ e_source_ldap_set_root_dn (ESourceLDAP *extension,
g_mutex_lock (extension->priv->property_lock);
+ if (g_strcmp0 (extension->priv->root_dn, root_dn) == 0) {
+ g_mutex_unlock (extension->priv->property_lock);
+ return;
+ }
+
g_free (extension->priv->root_dn);
extension->priv->root_dn = e_util_strdup_strip (root_dn);
@@ -614,6 +637,9 @@ e_source_ldap_set_scope (ESourceLDAP *extension,
{
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
+ if (extension->priv->scope == scope)
+ return;
+
extension->priv->scope = scope;
g_object_notify (G_OBJECT (extension), "scope");
@@ -633,6 +659,9 @@ e_source_ldap_set_security (ESourceLDAP *extension,
{
g_return_if_fail (E_IS_SOURCE_LDAP (extension));
+ if (extension->priv->security == security)
+ return;
+
extension->priv->security = security;
g_object_notify (G_OBJECT (extension), "security");