From 2f64945c0d6bef54f79ba32b8c2a6be692a31bb5 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 9 Jan 2009 16:15:21 +0000 Subject: Initialise the chatroom manager from empathy itself Signed-off-by: Sjoerd Simons svn path=/trunk/; revision=2186 --- libempathy/empathy-dispatcher.c | 8 +------- src/empathy.c | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index f004db0cb..0d67336c7 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -57,7 +57,6 @@ typedef struct { GHashTable *accounts; gpointer token; GSList *tubes; - EmpathyChatroomManager *chatroom_mgr; } EmpathyDispatcherPriv; G_DEFINE_TYPE (EmpathyDispatcher, empathy_dispatcher, G_TYPE_OBJECT); @@ -820,9 +819,8 @@ dispatcher_finalize (GObject *object) g_object_unref (priv->account_manager); g_object_unref (priv->mc); + g_hash_table_destroy (priv->accounts); g_hash_table_destroy (priv->connections); - - g_object_unref (priv->chatroom_mgr); } static void @@ -896,10 +894,6 @@ empathy_dispatcher_init (EmpathyDispatcher *dispatcher) g_object_unref (l->data); } g_list_free (accounts); - - /* FIXME thisshould probably be created by another object.. */ - priv->chatroom_mgr = empathy_chatroom_manager_dup_singleton (NULL); - empathy_chatroom_manager_observe (priv->chatroom_mgr, dispatcher); } EmpathyDispatcher * diff --git a/src/empathy.c b/src/empathy.c index 441242e57..5da2b2529 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -390,6 +391,7 @@ main (int argc, char *argv[]) guint32 startup_timestamp; EmpathyStatusIcon *icon; EmpathyDispatcher *dispatcher; + EmpathyChatroomManager *chatroom_manager; GtkWidget *window; MissionControl *mc; EmpathyIdle *idle; @@ -516,6 +518,9 @@ main (int argc, char *argv[]) dispatcher = empathy_dispatcher_dup_singleton (); g_signal_connect (dispatcher, "dispatch", G_CALLBACK (dispatch_cb), NULL); + chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL); + empathy_chatroom_manager_observe (chatroom_manager, dispatcher); + gtk_main (); empathy_idle_set_state (idle, MC_PRESENCE_OFFLINE); @@ -524,6 +529,7 @@ main (int argc, char *argv[]) g_object_unref (idle); g_object_unref (icon); g_object_unref (dispatcher); + g_object_unref (chatroom_manager); return EXIT_SUCCESS; } -- cgit v1.2.3