aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-05-13 02:04:01 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-13 02:04:01 +0800
commit321de615c0d7aaecf7f87b31fae65b5b75f0e32e (patch)
tree25d012f82bb5b54e5e06a0b51de1722314c67f2a /libempathy
parent104362fe34c3881f6956844de2a0403f0ea1b3d0 (diff)
downloadgsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar.gz
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar.bz2
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar.lz
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar.xz
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.tar.zst
gsoc2013-empathy-321de615c0d7aaecf7f87b31fae65b5b75f0e32e.zip
[darcs-to-svn @ gossip_mission_control_new() returns a MissionControl sigleton object and update throbber state when there is connecting accounts]
svn path=/trunk/; revision=47
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact-list.c4
-rw-r--r--libempathy/empathy-contact-manager.c3
-rw-r--r--libempathy/empathy-tp-chat.c7
-rw-r--r--libempathy/gossip-utils.c16
-rw-r--r--libempathy/gossip-utils.h4
5 files changed, 27 insertions, 7 deletions
diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c
index f1cede9eb..6966ba23f 100644
--- a/libempathy/empathy-contact-list.c
+++ b/libempathy/empathy-contact-list.c
@@ -25,9 +25,9 @@
#include <string.h>
+#include <libtelepathy/tp-helpers.h>
#include <libtelepathy/tp-conn.h>
#include <libtelepathy/tp-chan.h>
-#include <libtelepathy/tp-helpers.h>
#include <libtelepathy/tp-chan-type-contact-list-gen.h>
#include <libtelepathy/tp-conn-iface-aliasing-gen.h>
#include <libtelepathy/tp-conn-iface-presence-gen.h>
@@ -324,7 +324,7 @@ empathy_contact_list_new (McAccount *account)
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
- mc = mission_control_new (tp_get_bus ());
+ mc = gossip_mission_control_new ();
if (mission_control_get_connection_status (mc, account, NULL) != 0) {
/* The account is not connected, nothing to do. */
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index 50ed576b5..ebc6b0573 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -24,7 +24,6 @@
#include <string.h>
-#include <libtelepathy/tp-helpers.h>
#include <libtelepathy/tp-constants.h>
#include "empathy-contact-manager.h"
@@ -140,7 +139,7 @@ empathy_contact_manager_init (EmpathyContactManager *manager)
(GDestroyNotify) g_object_unref,
(GDestroyNotify) g_object_unref);
- priv->mc = mission_control_new (tp_get_bus ());
+ priv->mc = gossip_mission_control_new ();
dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc),
"AccountStatusChanged",
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 4729cc267..2e5444fb1 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -22,10 +22,10 @@
#include <config.h>
-#include <libtelepathy/tp-helpers.h>
#include <libtelepathy/tp-chan-type-text-gen.h>
#include <libtelepathy/tp-chan-iface-chat-state-gen.h>
#include <libtelepathy/tp-conn.h>
+#include <libtelepathy/tp-helpers.h>
#include "empathy-tp-chat.h"
#include "empathy-contact-manager.h"
@@ -33,6 +33,7 @@
#include "empathy-marshal.h"
#include "gossip-debug.h"
#include "gossip-time.h"
+#include "gossip-utils.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
EMPATHY_TYPE_TP_CHAT, EmpathyTpChatPriv))
@@ -198,7 +199,7 @@ empathy_tp_chat_new (McAccount *account,
priv->list = empathy_contact_manager_get_list (priv->manager, account);
priv->tp_chan = g_object_ref (tp_chan);
priv->account = g_object_ref (account);
- priv->mc = mission_control_new (tp_get_bus ());
+ priv->mc = gossip_mission_control_new ();
g_object_ref (priv->list);
priv->text_iface = tp_chan_get_interface (tp_chan,
@@ -242,7 +243,7 @@ empathy_tp_chat_new_with_contact (GossipContact *contact)
g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
- mc = mission_control_new (tp_get_bus ());
+ mc = gossip_mission_control_new ();
account = gossip_contact_get_account (contact);
if (mission_control_get_connection_status (mc, account, NULL) != 0) {
diff --git a/libempathy/gossip-utils.c b/libempathy/gossip-utils.c
index 668898712..b8cc59ab7 100644
--- a/libempathy/gossip-utils.c
+++ b/libempathy/gossip-utils.c
@@ -34,6 +34,7 @@
#include <libxml/uri.h>
#include <libmissioncontrol/mc-account.h>
+#include <libtelepathy/tp-helpers.h>
#include "gossip-debug.h"
#include "gossip-utils.h"
@@ -448,3 +449,18 @@ gossip_get_own_contact_from_contact (GossipContact *contact)
return own_contact;
}
+MissionControl *
+gossip_mission_control_new (void)
+{
+ static MissionControl *mc = NULL;
+
+ if (!mc) {
+ mc = mission_control_new (tp_get_bus ());
+ g_object_add_weak_pointer (G_OBJECT (mc), (gpointer) &mc);
+ } else {
+ g_object_ref (mc);
+ }
+
+ return mc;
+}
+
diff --git a/libempathy/gossip-utils.h b/libempathy/gossip-utils.h
index ee093fe65..e1e9baeed 100644
--- a/libempathy/gossip-utils.h
+++ b/libempathy/gossip-utils.h
@@ -32,6 +32,8 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <libmissioncontrol/mission-control.h>
+
#include "gossip-contact.h"
G_BEGIN_DECLS
@@ -87,6 +89,8 @@ guint gossip_account_hash (gconstpointer key);
gboolean gossip_account_equal (gconstpointer a,
gconstpointer b);
GossipContact * gossip_get_own_contact_from_contact (GossipContact *contact);
+MissionControl *gossip_mission_control_new (void);
+
G_END_DECLS
#endif /* __GOSSIP_UTILS_H__ */