aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-09-14 18:09:50 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-09-14 18:09:50 +0800
commit3a91ef0255c807c3e60f0a153b81ea3b1b427343 (patch)
treed323269a19fd84865ce1710a5a7768f334761112
parent6f1ccfd73f5bc6446b50f1d557691b90b1024210 (diff)
downloadgsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar.gz
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar.bz2
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar.lz
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar.xz
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.tar.zst
gsoc2013-empathy-3a91ef0255c807c3e60f0a153b81ea3b1b427343.zip
Watch the DBus signature of the param.
We used to hardcode UINT, but this does not work for haze CMs.
-rw-r--r--src/empathy-import-pidgin.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/empathy-import-pidgin.c b/src/empathy-import-pidgin.c
index 877eb26b6..ccf0dac7a 100644
--- a/src/empathy-import-pidgin.c
+++ b/src/empathy-import-pidgin.c
@@ -26,6 +26,7 @@
#include <glib.h>
#include <glib/gstdio.h>
+#include <dbus/dbus-protocol.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
@@ -139,12 +140,34 @@ import_dialog_pidgin_parse_setting (EmpathyImportAccountData *data,
}
else if (!tp_strdiff (type, "int"))
{
+ TpConnectionManager *cm = NULL;
+ const TpConnectionManagerProtocol *proto;
+ const TpConnectionManagerParam *param;
+ const gchar *signature;
+ int signature_i;
+
+ if (!empathy_import_protocol_is_supported (data->protocol, &cm))
+ return;
+
+ proto = tp_connection_manager_get_protocol (cm, data->protocol);
+ param = tp_connection_manager_protocol_get_param (proto, item->cm_name);
+ signature = tp_connection_manager_param_get_dbus_signature (param);
+ signature_i = (int) (*signature);
+
i = (gint) g_ascii_strtod (content, NULL);
- /* FIXME: Pidgin uses signed int values whereas Telepathy usually
- * uses unsigned int values.
- */
- value = tp_g_value_slice_new (G_TYPE_UINT);
- g_value_set_uint (value, (guint) i);
+
+ if (signature_i == DBUS_TYPE_INT16 ||
+ signature_i == DBUS_TYPE_INT32)
+ {
+ value = tp_g_value_slice_new (G_TYPE_INT);
+ g_value_set_int (value, i);
+ }
+ else if (signature_i == DBUS_TYPE_UINT16 ||
+ signature_i == DBUS_TYPE_UINT32)
+ {
+ value = tp_g_value_slice_new (G_TYPE_UINT);
+ g_value_set_uint (value, (guint) i);
+ }
}
else if (!tp_strdiff (type, "string"))
{