** Part of fix for bug #567861
authorMilan Crha <mcrha@redhat.com>
Mon, 9 Feb 2009 11:12:31 +0000 (11:12 +0000)
committerMilan Crha <mcrha@src.gnome.org>
Mon, 9 Feb 2009 11:12:31 +0000 (11:12 +0000)
2009-02-09  Milan Crha  <mcrha@redhat.com>

** Part of fix for bug #567861

* libedataserver/e-source.c: (e_source_equal):
Two sources also differ when one has set color_spec and the other not.

svn path=/trunk/; revision=10041

ChangeLog
libedataserver/e-source.c

index 1d4bae8..b5f6d59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-02-09  Milan Crha  <mcrha@redhat.com>
 
+       ** Part of fix for bug #567861
+
+       * libedataserver/e-source.c: (e_source_equal):
+       Two sources also differ when one has set color_spec and the other not.
+
+2009-02-09  Milan Crha  <mcrha@redhat.com>
+
        ** Fix for bug #555888
 
        * libedataserver/e-proxy.h:
index aadf1fb..240d875 100644 (file)
@@ -810,6 +810,8 @@ e_source_equal (ESource *a, ESource *b)
        g_return_val_if_fail (E_IS_SOURCE (a), FALSE); 
        g_return_val_if_fail (E_IS_SOURCE (b), FALSE); 
 
+       #define ONLY_ONE_NULL(aa, bb) (((aa) == NULL && (bb) != NULL) || ((aa) != NULL && (bb) == NULL))
+
        /* Compare source stuff */
        if (a->priv->uid 
         && b->priv->uid 
@@ -831,9 +833,10 @@ e_source_equal (ESource *a, ESource *b)
         && g_ascii_strcasecmp (a->priv->absolute_uri, b->priv->absolute_uri))
                return FALSE; 
 
-       if (a->priv->color_spec 
+       if ((a->priv->color_spec 
         && b->priv->color_spec 
-        && g_ascii_strcasecmp (a->priv->color_spec, b->priv->color_spec))
+        && g_ascii_strcasecmp (a->priv->color_spec, b->priv->color_spec)) ||
+        (ONLY_ONE_NULL (a->priv->color_spec, b->priv->color_spec)))
                return FALSE; 
 
        if (a->priv->readonly != b->priv->readonly)
@@ -842,6 +845,8 @@ e_source_equal (ESource *a, ESource *b)
        if (!compare_str_hashes (a->priv->properties, b->priv->properties))
                return FALSE; 
 
+       #undef ONLY_ONE_NULL
+
        return TRUE; 
 }