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:
Dan Winship
2012-05-10 09:00:45 -04:00
parent 538b2f106d
commit f8532a13e2
19 changed files with 180 additions and 311 deletions

View File

@@ -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);