aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-22 20:43:19 -0500
committerTed Gould <ted@canonical.com>2009-09-22 20:43:19 -0500
commit62c31bdc05a8084428133282dd78f9672f876b67 (patch)
tree957b9822bfa0b92d6982df3fe2e1d6669deac532
parent62fbd1f460c253a9a9770ec37a916dd2f55335dd (diff)
downloadayatana-indicator-session-62c31bdc05a8084428133282dd78f9672f876b67.tar.gz
ayatana-indicator-session-62c31bdc05a8084428133282dd78f9672f876b67.tar.bz2
ayatana-indicator-session-62c31bdc05a8084428133282dd78f9672f876b67.zip
Comments are good.
-rw-r--r--src/status-provider-mc5.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/status-provider-mc5.c b/src/status-provider-mc5.c
index a9342a1..45690ba 100644
--- a/src/status-provider-mc5.c
+++ b/src/status-provider-mc5.c
@@ -84,6 +84,8 @@ static void presence_changed (EmpathyAccountManager * eam, guint type, const gch
G_DEFINE_TYPE (StatusProviderMC5, status_provider_mc5, STATUS_PROVIDER_TYPE);
+/* Create the class. We over ride a few functions but nothing
+ really shocking. Most interesting is the set and get status. */
static void
status_provider_mc5_class_init (StatusProviderMC5Class *klass)
{
@@ -102,7 +104,10 @@ status_provider_mc5_class_init (StatusProviderMC5Class *klass)
return;
}
-
+/* Creating an instance of the status provider. We set the variables
+ and create an EmpathyAccountManager object. It does all the hard
+ work in this module of tracking MissionControl and enumerating the
+ accounts and all that jazz. */
static void
status_provider_mc5_init (StatusProviderMC5 *self)
{
@@ -116,6 +121,8 @@ status_provider_mc5_init (StatusProviderMC5 *self)
return;
}
+/* Unref the account manager and move on. Sadly, we're
+ leaving the show. */
static void
status_provider_mc5_dispose (GObject *object)
{
@@ -130,6 +137,7 @@ status_provider_mc5_dispose (GObject *object)
return;
}
+/* Pass to superclass */
static void
status_provider_mc5_finalize (GObject *object)
{
@@ -152,6 +160,10 @@ status_provider_mc5_new (void)
return STATUS_PROVIDER(g_object_new(STATUS_PROVIDER_MC5_TYPE, NULL));
}
+/* Setting the status in the empathy account manager. We're
+ basically requesting a global status. This may or may not
+ get applied to all accounts. It's really the best we can
+ hope to do. */
static void
set_status (StatusProvider * sp, StatusProviderStatus status)
{
@@ -168,6 +180,8 @@ set_status (StatusProvider * sp, StatusProviderStatus status)
return;
}
+/* Gets the status, uses the cached value that we have. Asking
+ would just be painful. */
static StatusProviderStatus
get_status (StatusProvider * sp)
{
@@ -181,6 +195,9 @@ get_status (StatusProvider * sp)
return priv->status;
}
+/* A signal handler for when the EmpatyAccountManager believes
+ that the global status has changed. It roughly calculates this
+ by finding the most available of all accounts that are active. */
static void
presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
{
@@ -195,3 +212,4 @@ presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_st
return;
}
+