mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
gio: Add g_async_result_legacy_propagate_error()
Finish deprecating the "handle GSimpleAsyncResult errors in the wrapper function" idiom (and protect against future GSimpleAsyncResult deprecation warnings) by adding a "legacy" GAsyncResult method to do it in those classes/methods where it had been traditionally done. (This applies only to wrapper methods; in cases where an _async vmethod explicitly uses GSimpleAsyncResult, its corresponding _finish vmethod still uses g_simple_async_result_propagate_error.) https://bugzilla.gnome.org/show_bug.cgi?id=667375 https://bugzilla.gnome.org/show_bug.cgi?id=661767
This commit is contained in:
parent
538b2f106d
commit
f8532a13e2
@ -1199,6 +1199,7 @@ GAsyncResultIface
|
||||
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
|
||||
|
@ -248,12 +248,8 @@ g_async_initable_init_finish (GAsyncInitable *initable,
|
||||
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);
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "gasyncresult.h"
|
||||
#include "gsimpleasyncresult.h"
|
||||
#include "glibintl.h"
|
||||
|
||||
|
||||
@ -152,3 +153,44 @@ g_async_result_get_source_object (GAsyncResult *res)
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -68,6 +68,10 @@ GType g_async_result_get_type (void) G_GNUC_CONST;
|
||||
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__ */
|
||||
|
@ -548,11 +548,12 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
|
||||
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)
|
||||
|
44
gio/gdrive.c
44
gio/gdrive.c
@ -391,13 +391,9 @@ g_drive_eject_finish (GDrive *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);
|
||||
|
||||
return (* iface->eject_finish) (drive, result, error);
|
||||
@ -475,12 +471,8 @@ g_drive_eject_with_operation_finish (GDrive *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);
|
||||
if (iface->eject_with_operation_finish != NULL)
|
||||
@ -547,13 +539,9 @@ g_drive_poll_for_media_finish (GDrive *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);
|
||||
|
||||
return (* iface->poll_for_media_finish) (drive, result, error);
|
||||
@ -755,12 +743,8 @@ g_drive_start_finish (GDrive *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);
|
||||
|
||||
@ -858,12 +842,8 @@ g_drive_stop_finish (GDrive *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);
|
||||
|
||||
|
189
gio/gfile.c
189
gio/gfile.c
@ -946,12 +946,8 @@ g_file_enumerate_children_finish (GFile *file,
|
||||
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);
|
||||
@ -1175,12 +1171,8 @@ g_file_query_info_finish (GFile *file,
|
||||
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);
|
||||
@ -1309,12 +1301,8 @@ g_file_query_filesystem_info_finish (GFile *file,
|
||||
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);
|
||||
@ -1423,12 +1411,8 @@ g_file_find_enclosing_mount_finish (GFile *file,
|
||||
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);
|
||||
@ -1902,12 +1886,8 @@ g_file_read_finish (GFile *file,
|
||||
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);
|
||||
@ -1974,12 +1954,8 @@ g_file_append_to_finish (GFile *file,
|
||||
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);
|
||||
@ -2047,12 +2023,8 @@ g_file_create_finish (GFile *file,
|
||||
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);
|
||||
@ -2127,13 +2099,9 @@ g_file_replace_finish (GFile *file,
|
||||
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);
|
||||
}
|
||||
@ -2201,13 +2169,9 @@ g_file_open_readwrite_finish (GFile *file,
|
||||
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);
|
||||
}
|
||||
@ -2279,13 +2243,9 @@ g_file_create_readwrite_finish (GFile *file,
|
||||
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);
|
||||
}
|
||||
@ -2363,13 +2323,9 @@ g_file_replace_readwrite_finish (GFile *file,
|
||||
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);
|
||||
}
|
||||
@ -3181,13 +3137,8 @@ g_file_copy_finish (GFile *file,
|
||||
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);
|
||||
@ -3715,12 +3666,8 @@ g_file_set_display_name_finish (GFile *file,
|
||||
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);
|
||||
@ -4317,12 +4264,8 @@ g_file_mount_mountable_finish (GFile *file,
|
||||
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);
|
||||
@ -4404,12 +4347,8 @@ g_file_unmount_mountable_finish (GFile *file,
|
||||
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);
|
||||
@ -4501,12 +4440,8 @@ g_file_unmount_mountable_with_operation_finish (GFile *file,
|
||||
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)
|
||||
@ -4589,13 +4524,9 @@ g_file_eject_mountable_finish (GFile *file,
|
||||
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);
|
||||
}
|
||||
@ -4684,12 +4615,8 @@ g_file_eject_mountable_with_operation_finish (GFile *file,
|
||||
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)
|
||||
@ -6130,13 +6057,9 @@ g_file_mount_enclosing_volume_finish (GFile *location,
|
||||
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);
|
||||
@ -7078,12 +7001,8 @@ g_file_start_mountable_finish (GFile *file,
|
||||
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);
|
||||
@ -7168,12 +7087,8 @@ g_file_stop_mountable_finish (GFile *file,
|
||||
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);
|
||||
@ -7252,12 +7167,8 @@ g_file_poll_mountable_finish (GFile *file,
|
||||
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);
|
||||
|
@ -405,11 +405,12 @@ g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
|
||||
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)
|
||||
@ -515,19 +516,14 @@ g_file_enumerator_close_finish (GFileEnumerator *enumerator,
|
||||
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);
|
||||
}
|
||||
|
@ -246,18 +246,13 @@ g_file_input_stream_query_info_finish (GFileInputStream *stream,
|
||||
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);
|
||||
|
@ -257,21 +257,16 @@ g_file_io_stream_query_info_async (GFileIOStream *stream,
|
||||
**/
|
||||
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);
|
||||
|
@ -256,18 +256,13 @@ g_file_output_stream_query_info_finish (GFileOutputStream *stream,
|
||||
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);
|
||||
|
@ -655,11 +655,12 @@ g_input_stream_read_finish (GInputStream *stream,
|
||||
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)
|
||||
@ -894,11 +895,12 @@ g_input_stream_skip_finish (GInputStream *stream,
|
||||
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)
|
||||
@ -992,11 +994,12 @@ g_input_stream_close_finish (GInputStream *stream,
|
||||
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)
|
||||
|
@ -119,6 +119,7 @@ g_desktop_app_info_set_desktop_env
|
||||
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
|
||||
|
@ -521,11 +521,12 @@ g_io_stream_close_finish (GIOStream *stream,
|
||||
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)
|
||||
|
@ -141,13 +141,9 @@ g_loadable_icon_load_finish (GLoadableIcon *icon,
|
||||
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);
|
||||
|
48
gio/gmount.c
48
gio/gmount.c
@ -392,12 +392,8 @@ g_mount_unmount_finish (GMount *mount,
|
||||
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);
|
||||
@ -471,12 +467,8 @@ g_mount_eject_finish (GMount *mount,
|
||||
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);
|
||||
@ -555,12 +547,8 @@ g_mount_unmount_with_operation_finish (GMount *mount,
|
||||
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)
|
||||
@ -642,12 +630,8 @@ g_mount_eject_with_operation_finish (GMount *mount,
|
||||
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)
|
||||
@ -728,12 +712,8 @@ g_mount_remount_finish (GMount *mount,
|
||||
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);
|
||||
@ -818,12 +798,8 @@ g_mount_guess_content_type_finish (GMount *mount,
|
||||
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);
|
||||
|
@ -841,11 +841,12 @@ g_output_stream_write_finish (GOutputStream *stream,
|
||||
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)
|
||||
@ -1074,18 +1075,13 @@ g_output_stream_splice_finish (GOutputStream *stream,
|
||||
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);
|
||||
@ -1171,11 +1167,12 @@ g_output_stream_flush_finish (GOutputStream *stream,
|
||||
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)
|
||||
@ -1293,11 +1290,12 @@ g_output_stream_close_finish (GOutputStream *stream,
|
||||
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)
|
||||
|
@ -445,13 +445,13 @@ g_resolver_lookup_by_name_finish (GResolver *resolver,
|
||||
|
||||
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)
|
||||
{
|
||||
@ -581,13 +581,8 @@ g_resolver_lookup_by_address_finish (GResolver *resolver,
|
||||
{
|
||||
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);
|
||||
@ -741,13 +736,8 @@ g_resolver_lookup_service_finish (GResolver *resolver,
|
||||
{
|
||||
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);
|
||||
|
@ -363,12 +363,8 @@ g_volume_mount_finish (GVolume *volume,
|
||||
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);
|
||||
@ -436,12 +432,8 @@ g_volume_eject_finish (GVolume *volume,
|
||||
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);
|
||||
@ -519,12 +511,8 @@ g_volume_eject_with_operation_finish (GVolume *volume,
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user