diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2009-11-09 17:21:00 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2009-11-09 17:21:00 +0800 |
commit | a74847a856efacde2142507fde3f7278e04a2f7c (patch) | |
tree | 342d7e42519a4de5ac3107ba60c2bcd0c7605902 /libempathy/empathy-idle.c | |
parent | 43f1111b8d907d5b5b2ab2dc665f896055483138 (diff) | |
download | gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar.gz gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar.bz2 gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar.lz gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar.xz gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.tar.zst gsoc2013-empathy-a74847a856efacde2142507fde3f7278e04a2f7c.zip |
[EmpathyIdle] track whether the AccountManager is ready, warn if it is not
Diffstat (limited to 'libempathy/empathy-idle.c')
-rw-r--r-- | libempathy/empathy-idle.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c index 8a0fcd88d..9889f1fdb 100644 --- a/libempathy/empathy-idle.c +++ b/libempathy/empathy-idle.c @@ -50,6 +50,8 @@ typedef struct { EmpathyConnectivity *connectivity; gulong state_change_signal_id; + gboolean ready; + TpConnectionPresenceType state; gchar *status; TpConnectionPresenceType flash_state; @@ -482,6 +484,8 @@ account_manager_ready_cb (GObject *source_object, GList *accounts, *l; GError *error = NULL; + priv->ready = TRUE; + if (!tp_account_manager_prepare_finish (account_manager, result, &error)) { DEBUG ("Failed to prepare account manager: %s", error->message); g_error_free (error); @@ -557,6 +561,10 @@ empathy_idle_get_state (EmpathyIdle *idle) priv = GET_PRIV (idle); + if (G_UNLIKELY (!priv->ready)) + g_critical (G_STRLOC ": %s called before AccountManager ready", + G_STRFUNC); + return priv->state; } @@ -578,6 +586,10 @@ empathy_idle_get_status (EmpathyIdle *idle) priv = GET_PRIV (idle); + if (G_UNLIKELY (!priv->ready)) + g_critical (G_STRLOC ": %s called before AccountManager ready", + G_STRFUNC); + if (!priv->status) { return empathy_presence_get_default_message (priv->state); } @@ -603,6 +615,10 @@ empathy_idle_get_flash_state (EmpathyIdle *idle) priv = GET_PRIV (idle); + if (G_UNLIKELY (!priv->ready)) + g_critical (G_STRLOC ": %s called before AccountManager ready", + G_STRFUNC); + return priv->flash_state; } |