Commit f83923c1 authored by Christian Hergert's avatar Christian Hergert

task: add ide_task_had_error()

This allows porting various code from gtask
parent 455fad16
......@@ -1959,6 +1959,22 @@ ide_task_set_name (IdeTask *self,
g_mutex_unlock (&priv->mutex);
}
gboolean
ide_task_had_error (IdeTask *self)
{
IdeTaskPrivate *priv = ide_task_get_instance_private (self);
gboolean ret;
g_return_val_if_fail (IDE_IS_TASK (self), FALSE);
g_mutex_lock (&priv->mutex);
ret = (priv->result != NULL && priv->result->type == IDE_TASK_RESULT_ERROR) ||
(priv->thread_result != NULL && priv->thread_result->type == IDE_TASK_RESULT_ERROR);
g_mutex_unlock (&priv->mutex);
return ret;
}
static gpointer
ide_task_get_user_data (GAsyncResult *result)
{
......
......@@ -76,6 +76,8 @@ gpointer ide_task_get_source_tag (IdeTask *self);
IDE_AVAILABLE_IN_3_28
gpointer ide_task_get_task_data (IdeTask *self);
IDE_AVAILABLE_IN_3_28
gboolean ide_task_had_error (IdeTask *self);
IDE_AVAILABLE_IN_3_28
gboolean ide_task_is_valid (gpointer self,
gpointer source_object);
IDE_AVAILABLE_IN_3_28
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment