Gio.Task.prototype.set_check_cancellable
function set_check_cancellable(check_cancellable: Boolean): void { // Gjs wrapper for g_task_set_check_cancellable() }
Sets or clears task's check-cancellable flag. If this is true (the default), then Gio.Task.prototype.propagate_pointer, etc, and Gio.Task.prototype.had_error will check the task's Gio.Cancellable first, and if it has been cancelled, then they will consider the task to have returned an "Operation was cancelled" error (Gio.IOErrorEnum.cancelled), regardless of any other error or return value the task may have had.
If check_cancellable is false, then the Gio.Task will not check the cancellable itself, and it is up to task's owner to do this (eg, via Gio.Task.prototype.return_error_if_cancelled).
If you are using Gio.Task.prototype.set_return_on_cancel as well, then you must leave check-cancellable set true.
Since 2.36
- check_cancellable
whether Gio.Task will check the state of its Gio.Cancellable for you.