]> git.0d.be Git - empathy.git/commitdiff
Emit notify signal only if the property value effectively changed.
authorXavier Claessens <xclaesse@gmail.com>
Sat, 9 Jun 2007 19:02:33 +0000 (19:02 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sat, 9 Jun 2007 19:02:33 +0000 (19:02 +0000)
2007-06-09 Xavier Claessens  <xclaesse@gmail.com>

* libempathy/gossip-contact.c: Emit notify signal only if the property
value effectively changed.

svn path=/trunk/; revision=141

ChangeLog
libempathy/gossip-contact.c

index 8af8853dc838876290faf66c3cb9c42ef96fc945..bb55d670fa2cdad9f9b59f3db480408acee1e58f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-09 Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy/gossip-contact.c: Emit notify signal only if the property
+       value effectively changed.
+
 2007-06-09 Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/gossip-contact-list-view.c: Fix warning for DnD.
index 86b6ee6e0c776854cc1cc9d7ccceaad4b7c12796..82147f67e848d774e3eeaf021636224480338138 100644 (file)
@@ -460,6 +460,10 @@ gossip_contact_set_id (GossipContact *contact,
 
        priv = GET_PRIV (contact);
 
+       if (priv->id && strcmp (id, priv->id) == 0) {
+               return;
+       }
+
        g_free (priv->id);
        priv->id = g_strdup (id);
 
@@ -477,6 +481,10 @@ gossip_contact_set_name (GossipContact *contact,
 
        priv = GET_PRIV (contact);
 
+       if (priv->name && strcmp (name, priv->name) == 0) {
+               return;
+       }
+
        g_free (priv->name);
        priv->name = g_strdup (name);
 
@@ -493,6 +501,10 @@ gossip_contact_set_avatar (GossipContact *contact,
 
        priv = GET_PRIV (contact);
 
+       if (priv->avatar == avatar) {
+               return;
+       }
+
        if (priv->avatar) {
                gossip_avatar_unref (priv->avatar);
                priv->avatar = NULL;
@@ -516,6 +528,10 @@ gossip_contact_set_account (GossipContact *contact,
 
        priv = GET_PRIV (contact);
 
+       if (account == priv->account) {
+               return;
+       }
+
        if (priv->account) {
                g_object_unref (priv->account);
        }
@@ -534,6 +550,10 @@ gossip_contact_set_presence (GossipContact  *contact,
 
        priv = GET_PRIV (contact);
 
+       if (presence == priv->presence) {
+               return;
+       }
+
        if (priv->presence) {
                g_object_unref (priv->presence);
                priv->presence = NULL;
@@ -581,6 +601,10 @@ gossip_contact_set_subscription (GossipContact      *contact,
 
        priv = GET_PRIV (contact);
 
+       if (priv->subscription == subscription) {
+               return;
+       }
+
        priv->subscription = subscription;
 
        g_object_notify (G_OBJECT (contact), "subscription");
@@ -596,6 +620,10 @@ gossip_contact_set_handle (GossipContact *contact,
 
        priv = GET_PRIV (contact);
 
+       if (priv->handle == handle) {
+               return;
+       }
+
        priv->handle = handle;
 
        g_object_notify (G_OBJECT (contact), "handle");