setCheckCancellable

open fun setCheckCancellable(checkCancellable: Boolean)

Sets or clears @task's check-cancellable flag. If this is true (the default), then g_task_propagate_pointer(), etc, and g_task_had_error() will check the task's #GCancellable first, and if it has been cancelled, then they will consider the task to have returned an "Operation was cancelled" error (%G_IO_ERROR_CANCELLED), regardless of any other error or return value the task may have had.

If @check_cancellable is false, then the #GTask will not check the cancellable itself, and it is up to @task's owner to do this (eg, via g_task_return_error_if_cancelled()).

If you are using g_task_set_return_on_cancel() as well, then you must leave check-cancellable set true.

Since

2.36

Parameters

checkCancellable

whether #GTask will check the state of its #GCancellable for you.