static void
carrick_list_set_property (GObject *object, guint property_id,
                           const GValue *value, GParamSpec *pspec)
{
  CarrickListPrivate *priv = LIST_PRIVATE (object);

  switch (property_id)
    {
    case PROP_ICON_FACTORY:
      priv->icon_factory = CARRICK_ICON_FACTORY (g_value_get_object (value));
      break;

    case PROP_NOTIFICATIONS:
      priv->notes = CARRICK_NOTIFICATION_MANAGER (g_value_get_object (value));
      break;

    case PROP_MODEL:
      carrick_list_set_model (CARRICK_LIST (object),
                              CARRICK_NETWORK_MODEL (g_value_get_object (value)));
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
    }
}
static void
on_note_closed (NotifyNotification *note, gpointer user_data)
{
  CarrickNotificationManager *manager = CARRICK_NOTIFICATION_MANAGER (user_data);
  CarrickNotificationManagerPrivate *priv = manager->priv;

  if (priv->note) {
    g_object_unref (priv->note);
    priv->note = NULL;
  }
}
static void
carrick_notification_manager_finalize (GObject *object)
{
  CarrickNotificationManager *self = CARRICK_NOTIFICATION_MANAGER (object);
  CarrickNotificationManagerPrivate *priv = self->priv;

  g_free (priv->last_type);
  g_free (priv->last_name);
  g_free (priv->last_state);
  g_free (priv->queued_type);
  g_free (priv->queued_name);

  G_OBJECT_CLASS (carrick_notification_manager_parent_class)->finalize (object);
}
static void
carrick_notification_manager_dispose (GObject *object)
{
  CarrickNotificationManager *self = CARRICK_NOTIFICATION_MANAGER (object);
  CarrickNotificationManagerPrivate *priv = self->priv;

  if (priv->note) {
    notify_notification_close (priv->note, NULL);
    g_signal_handlers_disconnect_by_func (priv->note, on_note_closed, self);
    g_object_unref (priv->note);
    priv->note = NULL;
  }

  notify_uninit ();

  G_OBJECT_CLASS (carrick_notification_manager_parent_class)->dispose (object);
}