empathy r2186 - in trunk: libempathy src



Author: xclaesse
Date: Fri Jan  9 16:15:21 2009
New Revision: 2186
URL: http://svn.gnome.org/viewvc/empathy?rev=2186&view=rev

Log:
Initialise the chatroom manager from empathy itself

Signed-off-by: Sjoerd Simons <sjoerd simons collabora co uk>

Modified:
   trunk/libempathy/empathy-dispatcher.c
   trunk/src/empathy.c

Modified: trunk/libempathy/empathy-dispatcher.c
==============================================================================
--- trunk/libempathy/empathy-dispatcher.c	(original)
+++ trunk/libempathy/empathy-dispatcher.c	Fri Jan  9 16:15:21 2009
@@ -57,7 +57,6 @@
   GHashTable     *accounts;
   gpointer       token;
   GSList         *tubes;
-  EmpathyChatroomManager *chatroom_mgr;
 } EmpathyDispatcherPriv;
 
 G_DEFINE_TYPE (EmpathyDispatcher, empathy_dispatcher, G_TYPE_OBJECT);
@@ -820,9 +819,8 @@
   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 @@
     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 *

Modified: trunk/src/empathy.c
==============================================================================
--- trunk/src/empathy.c	(original)
+++ trunk/src/empathy.c	Fri Jan  9 16:15:21 2009
@@ -39,6 +39,7 @@
 
 #include <libempathy/empathy-idle.h>
 #include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-chatroom-manager.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-dispatch-operation.h>
 #include <libempathy/empathy-tp-chat.h>
@@ -390,6 +391,7 @@
 	guint32            startup_timestamp;
 	EmpathyStatusIcon *icon;
 	EmpathyDispatcher *dispatcher;
+	EmpathyChatroomManager *chatroom_manager;
 	GtkWidget         *window;
 	MissionControl    *mc;
 	EmpathyIdle       *idle;
@@ -516,6 +518,9 @@
 	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 @@
 	g_object_unref (idle);
 	g_object_unref (icon);
 	g_object_unref (dispatcher);
+	g_object_unref (chatroom_manager);
 
 	return EXIT_SUCCESS;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]