gdk: Change some async dnd api

The pattern we generally follow is to put the
async result right after the source object, in
finish functions. Do this for gdk_drop_read_finish.
This commit is contained in:
Matthias Clasen 2019-04-02 11:38:52 +00:00
parent 8e4e4401c5
commit 64fd5158bf
8 changed files with 13 additions and 13 deletions

View File

@ -149,8 +149,8 @@ gdk_drop_read_local_async (GdkDrop *self,
static GInputStream *
gdk_drop_read_local_finish (GdkDrop *self,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
@ -622,8 +622,8 @@ gdk_drop_read_async (GdkDrop *self,
/**
* gdk_drop_read_finish:
* @self: a #GdkDrop
* @out_mime_type: (out) (type utf8): return location for the used mime type
* @result: a #GAsyncResult
* @out_mime_type: (out) (type utf8): return location for the used mime type
* @error: (allow-none): location to store error information on failure, or %NULL
*
* Finishes an async drop read operation, see gdk_drop_read_async().
@ -632,8 +632,8 @@ gdk_drop_read_async (GdkDrop *self,
*/
GInputStream *
gdk_drop_read_finish (GdkDrop *self,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
g_return_val_if_fail (GDK_IS_DROP (self), NULL);
@ -641,11 +641,11 @@ gdk_drop_read_finish (GdkDrop *self,
if (g_async_result_is_tagged (result, gdk_drop_read_local_async))
{
return gdk_drop_read_local_finish (self, out_mime_type, result, error);
return gdk_drop_read_local_finish (self, result, out_mime_type, error);
}
else
{
return GDK_DROP_GET_CLASS (self)->read_finish (self, out_mime_type, result, error);
return GDK_DROP_GET_CLASS (self)->read_finish (self, result, out_mime_type, error);
}
}
@ -678,7 +678,7 @@ gdk_drop_read_value_got_stream (GObject *source,
GTask *task = data;
const char *mime_type;
stream = gdk_drop_read_finish (GDK_DROP (source), &mime_type, result, &error);
stream = gdk_drop_read_finish (GDK_DROP (source), result, &mime_type, &error);
if (stream == NULL)
{
g_task_return_error (task, error);

View File

@ -68,8 +68,8 @@ void gdk_drop_read_async (GdkDrop
gpointer user_data);
GDK_AVAILABLE_IN_ALL
GInputStream * gdk_drop_read_finish (GdkDrop *self,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error);
GDK_AVAILABLE_IN_ALL
void gdk_drop_read_value_async (GdkDrop *self,

View File

@ -51,8 +51,8 @@ struct _GdkDropClass {
GAsyncReadyCallback callback,
gpointer user_data);
GInputStream * (* read_finish) (GdkDrop *self,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error);
};

View File

@ -224,8 +224,8 @@ gdk_wayland_drop_read_async (GdkDrop *drop,
static GInputStream *
gdk_wayland_drop_read_finish (GdkDrop *drop,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;

View File

@ -331,8 +331,8 @@ gdk_wayland_primary_read_async (GdkClipboard *clipboard,
static GInputStream *
gdk_wayland_primary_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GInputStream *stream;

View File

@ -1382,8 +1382,8 @@ gdk_win32_drop_read_async (GdkDrop *drop,
static GInputStream *
gdk_win32_drop_read_finish (GdkDrop *drop,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;

View File

@ -211,8 +211,8 @@ gdk_x11_drop_read_async (GdkDrop *drop,
static GInputStream *
gdk_x11_drop_read_finish (GdkDrop *drop,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;

View File

@ -244,7 +244,7 @@ gtk_drag_get_data_got_stream (GObject *source,
GInputStream *input_stream;
GOutputStream *output_stream;
input_stream = gdk_drop_read_finish (GDK_DROP (source), &data->mime_type, result, NULL);
input_stream = gdk_drop_read_finish (GDK_DROP (source), result, &data->mime_type, NULL);
if (input_stream == NULL)
{
gtk_drag_get_data_finish (data, NULL, 0);