Esempio n. 1
0
static void
error_cb (RBEncoder *encoder, GError *error, TransferData *data)
{
	/* ignore 'file exists' */
	if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
		rb_debug ("ignoring 'file exists' error for %s", data->dest);
		data->failed = TRUE;
		return;
	}

	rb_debug ("Error transferring track to %s: %s", data->dest, error->message);
	rb_error_dialog (NULL, _("Error transferring track"), "%s", error->message);

	data->failed = TRUE;
	rb_encoder_cancel (encoder);
}
/**
 * _rb_track_transfer_batch_cancel:
 * @batch: a #RBTrackTransferBatch
 *
 * Cancels a batch transfer.  Only to be called by the #RBTrackTransferQueue.
 */
void
_rb_track_transfer_batch_cancel (RBTrackTransferBatch *batch)
{
	batch->priv->cancelled = TRUE;
	rb_debug ("batch being cancelled");

	if (batch->priv->current_encoder != NULL) {
		rb_encoder_cancel (batch->priv->current_encoder);

		/* other things take care of cleaning up the encoder */
	}

	g_signal_emit (batch, signals[CANCELLED], 0);

	/* anything else? */
}