GAsyncResult *res,
GError **error)
{
- /* Although g_async_initable_init_finish() does this error handling
- * as well, we do it here too, so that a class that reimplements
- * GAsyncInitable can properly run its parent class's implementation
- * by directly invoking its ->init_async() and ->init_finish().
- */
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ GSimpleAsyncResult *simple;
+
+ g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (initable),
+ g_async_initable_real_init_async),
+ FALSE);
+ simple = G_SIMPLE_ASYNC_RESULT (res);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
return TRUE;
}
simple = G_SIMPLE_ASYNC_RESULT (result);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_real_fill_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return -1;
+
nread = g_simple_async_result_get_op_res_gssize (simple);
return nread;
}
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_query_info_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
return g_object_ref (data->info);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_query_filesystem_info_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
return g_object_ref (data->info);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_enumerate_children_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->enumerator)
return g_object_ref (data->enumerator);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_read_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
return g_object_ref (op);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_append_to_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
return g_object_ref (op);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_create_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
return g_object_ref (op);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_replace_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->stream)
return g_object_ref (data->stream);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_open_readwrite_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
return g_object_ref (op);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_create_readwrite_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
return g_object_ref (op);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_replace_readwrite_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->stream)
return g_object_ref (data->stream);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_set_display_name_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->file)
return g_object_ref (data->file);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_find_enclosing_mount_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
mount = g_simple_async_result_get_op_res_gpointer (simple);
return g_object_ref (mount);
}
GAsyncResult *res,
GError **error)
{
- /* Error handled in g_file_copy_finish() */
+ GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
return TRUE;
}
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_next_files_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
res = op->files;
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_close_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
return TRUE;
}
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_input_stream_real_query_info_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
return g_object_ref (data->info);
static GFileInfo *
g_file_output_stream_real_query_info_finish (GFileOutputStream *stream,
- GAsyncResult *res,
- GError **error)
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_output_stream_real_query_info_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
return g_object_ref (data->info);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_input_stream_real_read_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return -1;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->count_read;
SkipData *op;
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_skip_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return -1;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->count_skipped;
}
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
return TRUE;
}
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_io_stream_real_close_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
return TRUE;
}
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_loadable_icon_real_load_async);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return NULL;
+
data = g_simple_async_result_get_op_res_gpointer (simple);
if (type)
WriteData *op;
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_write_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return -1;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->count_written;
}
SpliceData *op;
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_splice_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return -1;
+
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->bytes_copied;
}
GAsyncResult *result,
GError **error)
{
+ GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
return TRUE;
}
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_close_async);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
return TRUE;
}