[Spice-commits] src/spice-widget.c
Pavel Grunt
pgrunt at kemper.freedesktop.org
Wed Sep 14 11:10:01 UTC 2016
src/spice-widget.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
New commits:
commit 53c503d96ccd01b1c7a3c62c54ebf1e72af6674b
Author: Pavel Grunt <pgrunt at redhat.com>
Date: Wed Sep 14 10:03:31 2016 +0200
widget: Inform about transfer failure
Call spice_main_file_copy_finish to get result of the transfer
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 9c8f7d1..06e332f 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -499,6 +499,24 @@ static gboolean grab_broken(SpiceDisplay *self, GdkEventGrabBroken *event,
return false;
}
+static void file_transfer_callback(GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data G_GNUC_UNUSED)
+{
+ SpiceMainChannel *channel = SPICE_MAIN_CHANNEL(source_object);
+ GError *error = NULL;
+
+ if (spice_main_file_copy_finish(channel, result, &error))
+ return;
+
+ if (error != NULL && error->message != NULL)
+ g_warning("File transfer failed with error: %s", error->message);
+ else
+ g_warning("File transfer failed");
+
+ g_clear_error(&error);
+}
+
static void drag_data_received_callback(SpiceDisplay *self,
GdkDragContext *drag_context,
gint x,
@@ -531,7 +549,7 @@ static void drag_data_received_callback(SpiceDisplay *self,
g_strfreev(file_urls);
spice_main_file_copy_async(d->main, files, 0, NULL, NULL,
- NULL, NULL, NULL);
+ NULL, file_transfer_callback, NULL);
for (i = 0; i < n_files; i++) {
g_object_unref(files[i]);
}
More information about the Spice-commits
mailing list