static void idle_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { EmpathyIdlePriv *priv; EmpathyIdle *idle; priv = GET_PRIV (object); idle = EMPATHY_IDLE (object); switch (param_id) { case PROP_STATE: empathy_idle_set_state (idle, g_value_get_enum (value)); break; case PROP_STATUS: empathy_idle_set_status (idle, g_value_get_string (value)); break; case PROP_FLASH_STATE: empathy_idle_set_flash_state (idle, g_value_get_enum (value)); break; case PROP_AUTO_AWAY: empathy_idle_set_auto_away (idle, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; }; }
static void idle_finalize (GObject *object) { EmpathyIdlePriv *priv; priv = GET_PRIV (object); g_free (priv->status); g_free (priv->requested_status_message); if (priv->gs_proxy) { g_object_unref (priv->gs_proxy); } g_signal_handler_disconnect (priv->connectivity, priv->state_change_signal_id); priv->state_change_signal_id = 0; if (priv->manager != NULL) { g_signal_handler_disconnect (priv->manager, priv->idle_presence_changed_id); g_object_unref (priv->manager); } g_object_unref (priv->connectivity); g_hash_table_destroy (priv->connect_times); priv->connect_times = NULL; idle_ext_away_stop (EMPATHY_IDLE (object)); }
static GObject * idle_constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *retval; if (idle_singleton) { retval = g_object_ref (idle_singleton); } else { retval = G_OBJECT_CLASS (empathy_idle_parent_class)->constructor (type, n_props, props); idle_singleton = EMPATHY_IDLE (retval); g_object_add_weak_pointer (retval, (gpointer) &idle_singleton); } return retval; }
static void idle_finalize (GObject *object) { EmpathyIdlePriv *priv; priv = GET_PRIV (object); g_free (priv->status); if (priv->gs_proxy) { g_object_unref (priv->gs_proxy); } g_signal_handler_disconnect (priv->connectivity, priv->state_change_signal_id); priv->state_change_signal_id = 0; g_object_unref (priv->connectivity); idle_ext_away_stop (EMPATHY_IDLE (object)); }
static void account_status_changed_cb (TpAccount *account, guint old_status, guint new_status, guint reason, gchar *dbus_error_name, GHashTable *details, gpointer user_data) { EmpathyIdle *idle = EMPATHY_IDLE (user_data); EmpathyIdlePriv *priv = GET_PRIV (idle); GTimeVal val; if (new_status == TP_CONNECTION_STATUS_CONNECTED) { g_get_current_time (&val); g_hash_table_insert (priv->connect_times, account, GINT_TO_POINTER (val.tv_sec)); } else if (new_status == TP_CONNECTION_STATUS_DISCONNECTED) { g_hash_table_remove (priv->connect_times, account); } }