summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-10-11 15:50:24 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-11-04 09:02:18 +0000
commit34b600adcb8894615fc2b40400ce6e740230f7c2 (patch)
tree76eec6979c54a2137e14ad2e98fb9aa9adb6ef4c
parentb3d5848804b8128b0962f4860efcd758e19d7fc3 (diff)
IMChannel: implement get_object_path_suffix
I think this is simpler than the factory passing the path in. Though it's actually longer, which offends me on some level.
-rw-r--r--src/im-channel.c8
-rw-r--r--src/im-factory.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/im-channel.c b/src/im-channel.c
index f335c9848..fdac5b224 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -176,6 +176,13 @@ gabble_im_channel_fill_immutable_properties (TpBaseChannel *chan,
NULL);
}
+static gchar *
+gabble_im_channel_get_object_path_suffix (TpBaseChannel *chan)
+{
+ return g_strdup_printf ("ImChannel%u",
+ tp_base_channel_get_target_handle (chan));
+}
+
static void
gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class)
{
@@ -196,6 +203,7 @@ gabble_im_channel_class_init (GabbleIMChannelClass *gabble_im_channel_class)
base_class->close = gabble_im_channel_close;
base_class->fill_immutable_properties =
gabble_im_channel_fill_immutable_properties;
+ base_class->get_object_path_suffix = gabble_im_channel_get_object_path_suffix;
tp_message_mixin_init_dbus_properties (object_class);
}
diff --git a/src/im-factory.c b/src/im-factory.c
index a5f249149..c110f82cc 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -352,7 +352,6 @@ new_im_channel (GabbleImFactory *fac,
GabbleImFactoryPrivate *priv;
TpBaseConnection *conn;
GabbleIMChannel *chan;
- char *object_path;
GSList *request_tokens;
TpHandle initiator;
@@ -367,18 +366,13 @@ new_im_channel (GabbleImFactory *fac,
else
initiator = handle;
- object_path = g_strdup_printf ("%s/ImChannel%u",
- conn->object_path, handle);
chan = g_object_new (GABBLE_TYPE_IM_CHANNEL,
"connection", priv->conn,
- "object-path", object_path,
"handle", handle,
"initiator-handle", initiator,
"requested", (handle != initiator),
NULL);
- DEBUG ("object path %s", object_path);
tp_base_channel_register ((TpBaseChannel *) chan);
- g_free (object_path);
g_signal_connect (chan, "closed", (GCallback) im_channel_closed_cb, fac);