summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-02 17:08:59 +0000
committerCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-02 17:08:59 +0000
commitb678ca070fbaac25b10f5794215f58771f3c4a25 (patch)
tree1d8e8ccf8d3da4a726f7a3b9d0f56f12371c2b7d /src
parentf08161df2b0e9f46271a5bb3ba5a15694642b169 (diff)
Improved channel-factory
* using GHashTable instead of static array for ChannelType+TplChannelContructor association * initialising the Channel Factory in src/telepathy-logger.c
Diffstat (limited to 'src')
-rw-r--r--src/telepathy-logger.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/telepathy-logger.c b/src/telepathy-logger.c
index 56f6ead..9820f74 100644
--- a/src/telepathy-logger.c
+++ b/src/telepathy-logger.c
@@ -21,18 +21,35 @@
#include <glib.h>
+#include <telepathy-logger/channel-factory.h>
+#include <telepathy-logger/channel-text.h>
#include <telepathy-logger/observer.h>
static GMainLoop *loop = NULL;
int main(int argc, char *argv[])
{
+ TplObserver *observer;
+ GError *error = NULL;
+
g_type_init ();
+ tpl_channel_factory_init ();
+
+ tpl_channel_factory_add ("org.freedesktop.Telepathy.Channel.Type.Text",
+ (TplChannelConstructor) tpl_channel_text_new);
- tpl_observer_new ();
+ observer = tpl_observer_new ();
+ if (tpl_observer_register_dbus (observer, &error) == FALSE)
+ {
+ g_debug ("Error during D-Bus registration: %s", error->message);
+ return 1;
+ }
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
+ g_object_unref (observer);
+ tpl_channel_factory_deinit ();
+
return 0;
}