diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-11-16 09:23:37 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-11-16 17:06:56 +0100 |
commit | 47d7c79be52f23b663e48af4eaeaba32dc486c43 (patch) | |
tree | 40edacf90c173d81a027596bc3f8a5975b62ba51 /gtk/usb-device-manager.h | |
parent | 40dee564a03da47cb301067e19ee9f16c8c92175 (diff) |
usb-device-manager: Make spice_usb_device_manager_connect_device async
With the (upcoming) introduction of the usb device node acl helper, which
uses policykit, spice_usbredir_channel_connect() may take a long time as
it will be waiting for the helper, which will be waiting for policykit which
may be interacting with the user. So spice_usbredir_channel_connect() will
need to become async, and since spice_usb_device_manager_connect_device
calls spice_usbredir_channel_connect it thus also needs to become async.
Note that this patch only changes spice_usb_device_manager_connect_device's
API to use the standard GIO async API, it is not actually async after this
patch since spice_usbredir_channel_connect is not yet async.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'gtk/usb-device-manager.h')
-rw-r--r-- | gtk/usb-device-manager.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/usb-device-manager.h b/gtk/usb-device-manager.h index 00f8eb2..2417674 100644 --- a/gtk/usb-device-manager.h +++ b/gtk/usb-device-manager.h @@ -22,6 +22,7 @@ #define __SPICE_USB_DEVICE_MANAGER_H__ #include "spice-client.h" +#include <gio/gio.h> G_BEGIN_DECLS @@ -96,9 +97,15 @@ GPtrArray *spice_usb_device_manager_get_devices(SpiceUsbDeviceManager *manager); gboolean spice_usb_device_manager_is_device_connected(SpiceUsbDeviceManager *manager, SpiceUsbDevice *device); -gboolean spice_usb_device_manager_connect_device(SpiceUsbDeviceManager *manager, - SpiceUsbDevice *device, - GError **err); +void spice_usb_device_manager_connect_device_async( + SpiceUsbDeviceManager *manager, + SpiceUsbDevice *device, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean spice_usb_device_manager_connect_device_finish( + SpiceUsbDeviceManager *self, GAsyncResult *res, GError **err); + void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *manager, SpiceUsbDevice *device); |