/* Returns: TRUE if @cancellable was cancelled, FALSE if it was not  */
gboolean g_cancellable_set_error_if_cancelled(GCancellable *cancellable, GError **error)
/* Returns: TRUE if @cancellable was cancelled, FALSE if it was not  */
gboolean g_cancellable_set_error_if_cancelled(GCancellable *cancellable, GError **error)
{
  if (g_cancellable_is_cancelled (cancellable))
    {
      g_set_error_literal (error,
                           G_IO_ERROR,
                           G_IO_ERROR_CANCELLED,
                           _("Operation was cancelled"));
      return TRUE;
    }
  return FALSE;
}