[Telepathy-commits] [telepathy-glib/master] Echo CM: implement Destroyable

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Oct 30 11:02:25 PDT 2008


---
 examples/cm/echo/chan.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/examples/cm/echo/chan.c b/examples/cm/echo/chan.c
index 0a7b938..0efb1ef 100644
--- a/examples/cm/echo/chan.c
+++ b/examples/cm/echo/chan.c
@@ -22,6 +22,7 @@
 
 static void text_iface_init (gpointer iface, gpointer data);
 static void channel_iface_init (gpointer iface, gpointer data);
+static void destroyable_iface_init (gpointer iface, gpointer data);
 
 G_DEFINE_TYPE_WITH_CODE (ExampleEchoChannel,
     example_echo_channel,
@@ -30,15 +31,10 @@ G_DEFINE_TYPE_WITH_CODE (ExampleEchoChannel,
       tp_dbus_properties_mixin_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL))
-
-/* FIXME: when supported, add:
-static void channel_iface_init (gpointer iface, gpointer data);
-
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE,
       destroyable_iface_init);
-*/
+    G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
+    G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL))
 
 /* type definition stuff */
 
@@ -71,8 +67,10 @@ struct _ExampleEchoChannelPrivate
   unsigned disposed:1;
 };
 
-static const char * example_echo_channel_interfaces[] = { NULL };
-/* FIXME: when supported, add TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE */
+static const char * example_echo_channel_interfaces[] = {
+    TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE,
+    NULL
+};
 
 static void
 example_echo_channel_init (ExampleEchoChannel *self)
@@ -510,8 +508,6 @@ text_iface_init (gpointer iface,
 #undef IMPLEMENT
 }
 
-/* FIXME: enable this when Destroyable is supported */
-#if 0
 static void
 destroyable_destroy (TpSvcChannelInterfaceDestroyable *iface,
                      DBusGMethodInvocation *context)
@@ -535,4 +531,3 @@ destroyable_iface_init (gpointer iface,
   IMPLEMENT (destroy);
 #undef IMPLEMENT
 }
-#endif
-- 
1.5.6.5




More information about the Telepathy-commits mailing list