GAsyncReadyCallback
g_async_result_get_user_data
g_async_result_get_source_object
+g_async_result_legacy_propagate_error
<SUBSECTION Standard>
G_ASYNC_RESULT
G_IS_ASYNC_RESULT
g_return_val_if_fail (G_IS_ASYNC_INITABLE (initable), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
- 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;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return FALSE;
iface = G_ASYNC_INITABLE_GET_IFACE (initable);
#include "config.h"
#include "gasyncresult.h"
+#include "gsimpleasyncresult.h"
#include "glibintl.h"
return (* iface->get_source_object) (res);
}
+
+/**
+ * g_async_result_legacy_propagate_error:
+ * @result: a #GAsyncResult
+ * @dest: (out): a location to propagate the error to.
+ *
+ * If @result is a #GSimpleAsyncResult, this is equivalent to
+ * g_simple_async_result_propagate_error(). Otherwise it returns
+ * %FALSE.
+ *
+ * This can be used for legacy error handling in async
+ * <literal>_finish ()</literal> wrapper functions that traditionally
+ * handled #GSimpleAsyncResult error returns themselves rather than
+ * calling into the virtual method. This should not be used in new
+ * code; #GAsyncResult errors that are set by virtual methods should
+ * also be extracted by virtual methods, to enable subclasses to chain
+ * up correctly.
+ *
+ * Returns: %TRUE if @error is has been filled in with an error from
+ * @res, %FALSE if not.
+ *
+ * Since: 2.34
+ **/
+gboolean
+g_async_result_legacy_propagate_error (GAsyncResult *res,
+ GError **error)
+{
+ /* This doesn't use a vmethod, because it's only for code that used
+ * to use GSimpleAsyncResult. (But it's a GAsyncResult method so
+ * that callers don't need to worry about GSimpleAsyncResult
+ * deprecation warnings in the future.)
+ */
+
+ if (G_IS_SIMPLE_ASYNC_RESULT (res))
+ {
+ return g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res),
+ error);
+ }
+ else
+ return FALSE;
+}
gpointer g_async_result_get_user_data (GAsyncResult *res);
GObject *g_async_result_get_source_object (GAsyncResult *res);
+GLIB_AVAILABLE_IN_2_34
+gboolean g_async_result_legacy_propagate_error (GAsyncResult *res,
+ GError **error);
+
G_END_DECLS
#endif /* __G_ASYNC_RESULT_H__ */
g_return_val_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return -1;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return -1;
/* Special case read of 0 bytes */
if (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_fill_async)
g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
-
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
iface = G_DRIVE_GET_IFACE (drive);
return (* iface->eject_finish) (drive, result, error);
g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_DRIVE_GET_IFACE (drive);
if (iface->eject_with_operation_finish != NULL)
g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
-
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
iface = G_DRIVE_GET_IFACE (drive);
return (* iface->poll_for_media_finish) (drive, result, error);
g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_DRIVE_GET_IFACE (drive);
g_return_val_if_fail (G_IS_DRIVE (drive), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_DRIVE_GET_IFACE (drive);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->enumerate_children_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->query_info_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->query_filesystem_info_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->find_enclosing_mount_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->read_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->append_to_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->create_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
-
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
+
iface = G_FILE_GET_IFACE (file);
return (* iface->replace_finish) (file, res, error);
}
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
-
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
+
iface = G_FILE_GET_IFACE (file);
return (* iface->open_readwrite_finish) (file, res, error);
}
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
-
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
+
iface = G_FILE_GET_IFACE (file);
return (* iface->create_readwrite_finish) (file, res, error);
}
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
-
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
+
iface = G_FILE_GET_IFACE (file);
return (* iface->replace_readwrite_finish) (file, res, error);
}
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
- 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;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
return (* iface->copy_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->set_display_name_finish) (file, res, error);
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
iface = G_FILE_GET_IFACE (file);
return (* iface->mount_mountable_finish) (file, result, error);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
return (* iface->unmount_mountable_finish) (file, result, error);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
if (iface->unmount_mountable_with_operation_finish != NULL)
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
-
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
iface = G_FILE_GET_IFACE (file);
return (* iface->eject_mountable_finish) (file, result, error);
}
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
if (iface->eject_mountable_with_operation_finish != NULL)
g_return_val_if_fail (G_IS_FILE (location), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
-
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
iface = G_FILE_GET_IFACE (location);
return (* iface->mount_enclosing_volume_finish) (location, result, error);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
return (* iface->start_mountable_finish) (file, result, error);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
return (* iface->stop_mountable_finish) (file, result, error);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_FILE_GET_IFACE (file);
return (* iface->poll_mountable_finish) (file, result, error);
g_return_val_if_fail (G_IS_FILE_ENUMERATOR (enumerator), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
/* Special case read of 0 files */
if (g_simple_async_result_get_source_tag (simple) == g_file_enumerator_next_files_async)
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple;
GFileEnumeratorClass *class;
g_return_val_if_fail (G_IS_FILE_ENUMERATOR (enumerator), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
-
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
class = G_FILE_ENUMERATOR_GET_CLASS (enumerator);
return class->close_finish (enumerator, result, error);
}
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple;
GFileInputStreamClass *class;
g_return_val_if_fail (G_IS_FILE_INPUT_STREAM (stream), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
class = G_FILE_INPUT_STREAM_GET_CLASS (stream);
return class->query_info_finish (stream, result, error);
**/
GFileInfo *
g_file_io_stream_query_info_finish (GFileIOStream *stream,
- GAsyncResult *result,
- GError **error)
+ GAsyncResult *result,
+ GError **error)
{
- GSimpleAsyncResult *simple;
GFileIOStreamClass *class;
g_return_val_if_fail (G_IS_FILE_IO_STREAM (stream), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
class = G_FILE_IO_STREAM_GET_CLASS (stream);
return class->query_info_finish (stream, result, error);
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple;
GFileOutputStreamClass *class;
g_return_val_if_fail (G_IS_FILE_OUTPUT_STREAM (stream), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
class = G_FILE_OUTPUT_STREAM_GET_CLASS (stream);
return class->query_info_finish (stream, result, error);
g_return_val_if_fail (G_IS_INPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return -1;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return -1;
/* Special case read of 0 bytes */
if (g_simple_async_result_get_source_tag (simple) == g_input_stream_read_async)
g_return_val_if_fail (G_IS_INPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return -1;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return -1;
/* Special case skip of 0 bytes */
if (g_simple_async_result_get_source_tag (simple) == g_input_stream_skip_async)
g_return_val_if_fail (G_IS_INPUT_STREAM (stream), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
/* Special case already closed */
if (g_simple_async_result_get_source_tag (simple) == g_input_stream_close_async)
g_async_result_get_type
g_async_result_get_user_data
g_async_result_get_source_object
+g_async_result_legacy_propagate_error
g_buffered_input_stream_get_type
g_buffered_input_stream_new
g_buffered_input_stream_new_sized
g_return_val_if_fail (G_IS_IO_STREAM (stream), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
/* Special case already closed */
if (g_simple_async_result_get_source_tag (simple) == g_io_stream_close_async)
g_return_val_if_fail (G_IS_LOADABLE_ICON (icon), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (res))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
-
+ if (g_async_result_legacy_propagate_error (res, error))
+ return NULL;
+
iface = G_LOADABLE_ICON_GET_IFACE (icon);
return (* iface->load_finish) (icon, res, type, error);
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_MOUNT_GET_IFACE (mount);
return (* iface->unmount_finish) (mount, result, error);
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_MOUNT_GET_IFACE (mount);
return (* iface->eject_finish) (mount, result, error);
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_MOUNT_GET_IFACE (mount);
if (iface->unmount_with_operation_finish != NULL)
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_MOUNT_GET_IFACE (mount);
if (iface->eject_with_operation_finish != NULL)
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_MOUNT_GET_IFACE (mount);
return (* iface->remount_finish) (mount, result, error);
g_return_val_if_fail (G_IS_MOUNT (mount), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
iface = G_MOUNT_GET_IFACE (mount);
return (* iface->guess_content_type_finish) (mount, result, error);
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return -1;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return -1;
/* Special case writes of 0 bytes */
if (g_simple_async_result_get_source_tag (simple) == g_output_stream_write_async)
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple;
GOutputStreamClass *class;
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return -1;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return -1;
class = G_OUTPUT_STREAM_GET_CLASS (stream);
return class->splice_finish (stream, result, error);
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
/* Special case default implementation */
if (g_simple_async_result_get_source_tag (simple) == g_output_stream_flush_async)
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
/* Special case already closed */
if (g_simple_async_result_get_source_tag (simple) == g_output_stream_close_async)
g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
+
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
-
/* Handle the stringified-IP-addr case */
if (g_simple_async_result_get_source_tag (simple) == g_resolver_lookup_by_name_async)
{
{
g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
return G_RESOLVER_GET_CLASS (resolver)->
lookup_by_address_finish (resolver, result, error);
{
g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return NULL;
return G_RESOLVER_GET_CLASS (resolver)->
lookup_service_finish (resolver, result, error);
g_return_val_if_fail (G_IS_VOLUME (volume), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_VOLUME_GET_IFACE (volume);
return (* iface->mount_finish) (volume, result, error);
g_return_val_if_fail (G_IS_VOLUME (volume), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_VOLUME_GET_IFACE (volume);
return (* iface->eject_finish) (volume, result, error);
g_return_val_if_fail (G_IS_VOLUME (volume), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
- if (G_IS_SIMPLE_ASYNC_RESULT (result))
- {
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- }
+ if (g_async_result_legacy_propagate_error (result, error))
+ return FALSE;
iface = G_VOLUME_GET_IFACE (volume);
if (iface->eject_with_operation_finish != NULL)