static void grl_optical_media_source_cancel (GrlSource *source, guint operation_id) { GCancellable *cancellable; cancellable = G_CANCELLABLE (grl_operation_get_data (operation_id)); if (cancellable) { g_cancellable_cancel (cancellable); } }
static void grl_local_metadata_source_cancel (GrlSource *source, guint operation_id) { GCancellable *cancellable = (GCancellable *) grl_operation_get_data (operation_id); if (cancellable) { g_cancellable_cancel (cancellable); } }
static void grl_raitv_source_cancel (GrlSource *source, guint operation_id) { RaitvOperation *op = grl_operation_get_data (operation_id); GRL_WARNING ("Cancelling id=%u", operation_id); if (!op) { GRL_WARNING ("\tNo such operation id=%u", operation_id); } if (op->cancellable) { g_cancellable_cancel (op->cancellable); } }
/* Returns: (transfer none) */ static GCancellable * resolve_data_ensure_cancellable (ResolveData *resolve_data) { GCancellable *cancellable; cancellable = grl_operation_get_data (resolve_data->rs->operation_id); if (cancellable) return cancellable; cancellable = g_cancellable_new (); /* The operation owns the cancellable */ grl_operation_set_data_full (resolve_data->rs->operation_id, cancellable, (GDestroyNotify) g_object_unref); return cancellable; }