aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-28 01:34:40 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-28 01:34:40 +0800
commit1403c791daa33f39c3dc86917c2f133ced2ae8f4 (patch)
treef795f24a9ed9718671a53cd60b9b28bc76127535
parent411439eb384aea34a05bbde805a236e97882895b (diff)
downloadgsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar.gz
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar.bz2
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar.lz
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar.xz
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.tar.zst
gsoc2013-empathy-1403c791daa33f39c3dc86917c2f133ced2ae8f4.zip
empathy_proxy_hash and _equal can be used only with proxies that unsure unique bus name.
svn path=/trunk/; revision=1127
-rw-r--r--libempathy/empathy-utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index f62d28e4c..3762b89ae 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -630,12 +630,13 @@ empathy_disconnect_account_status_changed (gpointer token)
guint
empathy_proxy_hash (gconstpointer key)
{
- TpProxy *proxy = TP_PROXY (key);
+ TpProxy *proxy = TP_PROXY (key);
+ TpProxyClass *proxy_class = TP_PROXY_GET_CLASS (key);
g_return_val_if_fail (TP_IS_PROXY (proxy), 0);
+ g_return_val_if_fail (proxy_class->must_have_unique_name, 0);
- return g_str_hash (proxy->object_path) +
- g_str_hash (proxy->bus_name);
+ return g_str_hash (proxy->object_path) ^ g_str_hash (proxy->bus_name);
}
gboolean
@@ -644,9 +645,13 @@ empathy_proxy_equal (gconstpointer a,
{
TpProxy *proxy_a = TP_PROXY (a);
TpProxy *proxy_b = TP_PROXY (b);
+ TpProxyClass *proxy_a_class = TP_PROXY_GET_CLASS (a);
+ TpProxyClass *proxy_b_class = TP_PROXY_GET_CLASS (b);
g_return_val_if_fail (TP_IS_PROXY (proxy_a), FALSE);
g_return_val_if_fail (TP_IS_PROXY (proxy_b), FALSE);
+ g_return_val_if_fail (proxy_a_class->must_have_unique_name, 0);
+ g_return_val_if_fail (proxy_b_class->must_have_unique_name, 0);
return g_str_equal (proxy_a->object_path, proxy_b->object_path) &&
g_str_equal (proxy_a->bus_name, proxy_b->bus_name);