empathy r1127 - trunk/libempathy
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1127 - trunk/libempathy
- Date: Tue, 27 May 2008 17:34:40 +0000 (UTC)
Author: xclaesse
Date: Tue May 27 17:34:40 2008
New Revision: 1127
URL: http://svn.gnome.org/viewvc/empathy?rev=1127&view=rev
Log:
empathy_proxy_hash and _equal can be used only with proxies that unsure unique bus name.
Modified:
trunk/libempathy/empathy-utils.c
Modified: trunk/libempathy/empathy-utils.c
==============================================================================
--- trunk/libempathy/empathy-utils.c (original)
+++ trunk/libempathy/empathy-utils.c Tue May 27 17:34:40 2008
@@ -630,12 +630,13 @@
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 @@
{
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]