[virt-tools-list] [PATCH virt-viewer 2/9] ovirt-foreign-menu: Fetch ISO names using GTask API

Eduardo Lima (Etrunko) etrunko at redhat.com
Wed Jan 18 19:12:49 UTC 2017


On 18/01/17 15:45, Christophe Fergeau wrote:
> On Wed, Jan 18, 2017 at 12:16:53PM -0200, Eduardo Lima (Etrunko) wrote:
>> Similar to the previous commit, the ISO dialog will fetch the result
>> asynchronously, rather than relying on the "notify::files" signal from
>> OvirtForeignMenu object. It also enables error to be shown if anything
>> goes wrong.
>>
>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
>> ---
>>  src/ovirt-foreign-menu.c | 170 +++++++++++++++++++++++++++--------------------
>>  src/ovirt-foreign-menu.h |   9 ++-
>>  src/remote-viewer.c      |  45 +++++++++++--
>>  3 files changed, 147 insertions(+), 77 deletions(-)
>>
>> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
>> index 366259a..50a8ea6 100644
>> --- a/src/ovirt-foreign-menu.c
>> +++ b/src/ovirt-foreign-menu.c
>> -static void ovirt_foreign_menu_refresh_cdrom_file_async(OvirtForeignMenu *menu)
>> +static void ovirt_foreign_menu_refresh_cdrom_file_async(OvirtForeignMenu *menu,
>> +                                                        GTask *task)
>>  {
>>      g_return_if_fail(OVIRT_IS_RESOURCE(menu->priv->cdrom));
>>  
>>      ovirt_resource_refresh_async(OVIRT_RESOURCE(menu->priv->cdrom),
>>                                   menu->priv->proxy, NULL,
>> -                                 cdrom_file_refreshed_cb, menu);
>> +                                 cdrom_file_refreshed_cb, task);
> 
> Since we have a GTask, we could pass the GCancellable it contains when
> we make ovirt_*_async() calls. Since we don't use the GCancellable
> functionality, that's probably not worth it ;)

You're right, for the sake of completeness, if some day we get to
implement the functionality, the change will be slightly easier. I have
replaced the NULL parameters with calls to g_task_get_cancellable(task).



-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20170118/b501db8a/attachment.sig>


More information about the virt-tools-list mailing list