diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-06-10 03:02:33 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-06-10 03:02:33 +0800 |
commit | e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3 (patch) | |
tree | af19245f49614193baf3be17ed05a6f93b13d40a /libempathy/gossip-contact.c | |
parent | d4ae6317c7150377911ad9e1b65a1f890a63a175 (diff) | |
download | gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar.gz gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar.bz2 gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar.lz gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar.xz gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.tar.zst gsoc2013-empathy-e5edcca865d02c8e28b7e6ba5c632e5806d6a0d3.zip |
Emit notify signal only if the property value effectively changed.
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
Diffstat (limited to 'libempathy/gossip-contact.c')
-rw-r--r-- | libempathy/gossip-contact.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy/gossip-contact.c b/libempathy/gossip-contact.c index 86b6ee6e0..82147f67e 100644 --- a/libempathy/gossip-contact.c +++ b/libempathy/gossip-contact.c @@ -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"); |