aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-18 19:44:55 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-19 07:12:11 +0800
commit0a24fbcba90ec2b36ede035ec6d9a9915a740e1a (patch)
treeed979d17b77f6f8470d7f1b35682fa81a3c5f7a8 /src
parentaadb68944951a49704d0bf4a018b22041432a25e (diff)
downloadgsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar.gz
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar.bz2
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar.lz
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar.xz
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.tar.zst
gsoc2013-empathy-0a24fbcba90ec2b36ede035ec6d9a9915a740e1a.zip
status-icon: use the account-manager directly to get our state and status
Also wait that he AM is ready before trying to get the status. Partially fix bug #601235.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 08024edf6..4c57d663d 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -36,7 +36,6 @@
#include <telepathy-glib/util.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-idle.h>
#include <libempathy-gtk/empathy-presence-chooser.h>
#include <libempathy-gtk/empathy-conf.h>
@@ -59,7 +58,6 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyStatusIcon)
typedef struct {
GtkStatusIcon *icon;
- EmpathyIdle *idle;
TpAccountManager *account_manager;
EmpathyNotifyManager *notify_mgr;
gboolean showing_event_icon;
@@ -222,7 +220,8 @@ status_icon_update_tooltip (EmpathyStatusIcon *icon)
priv->event->header);
gtk_status_icon_set_tooltip_markup (priv->icon, tooltip);
} else {
- tooltip = g_strdup (empathy_idle_get_status (priv->idle));
+ tp_account_manager_get_most_available_presence (
+ priv->account_manager, &tooltip, NULL);
gtk_status_icon_set_tooltip_text (priv->icon, tooltip);
}
@@ -240,7 +239,8 @@ status_icon_update_icon (EmpathyStatusIcon *icon)
} else {
TpConnectionPresenceType state;
- state = empathy_idle_get_state (priv->idle);
+ state = tp_account_manager_get_most_available_presence (
+ priv->account_manager, NULL, NULL);
/* An unset presence type here doesn't make sense. Force it
* to be offline. */
@@ -381,7 +381,7 @@ status_icon_toggle_visibility (EmpathyStatusIcon *icon)
}
static void
-status_icon_idle_notify_cb (EmpathyStatusIcon *icon)
+status_icon_presence_changed_cb (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv = GET_PRIV (icon);
@@ -550,7 +550,6 @@ status_icon_finalize (GObject *object)
}
g_object_unref (priv->icon);
- g_object_unref (priv->idle);
g_object_unref (priv->account_manager);
g_object_unref (priv->event_manager);
g_object_unref (priv->ui_manager);
@@ -590,6 +589,8 @@ account_manager_prepared_cb (GObject *source_object,
G_OBJECT (icon));
}
g_list_free (list);
+
+ status_icon_presence_changed_cb (icon);
}
static void
@@ -601,7 +602,6 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
icon->priv = priv;
priv->icon = gtk_status_icon_new ();
priv->account_manager = tp_account_manager_dup ();
- priv->idle = empathy_idle_dup_singleton ();
priv->event_manager = empathy_event_manager_dup_singleton ();
tp_account_manager_prepare_async (priv->account_manager, NULL,
@@ -614,10 +614,10 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
icon);
status_icon_create_menu (icon);
- status_icon_idle_notify_cb (icon);
- g_signal_connect_swapped (priv->idle, "notify",
- G_CALLBACK (status_icon_idle_notify_cb),
+ g_signal_connect_swapped (priv->account_manager,
+ "most-available-presence-changed",
+ G_CALLBACK (status_icon_presence_changed_cb),
icon);
g_signal_connect (priv->event_manager, "event-added",
G_CALLBACK (status_icon_event_added_cb),