Re: [Vala] Getting results from an async callback



Il 27/07/2012 17:34, Matthias Klumpp ha scritto:
Hi!
You recieve a AsyncResult in that callback. For examples how to use
PackageKit in Vala, see my Listaller[1] project or - for a
less-complex example (Listaller uses some internal PK APIs) - just
checkout this snipped which addresses your question:
http://bazaar.launchpad.net/~lubuntu-software-center-team/light-software-center/trunk/view/head:/src/Backend/AppsManager.vala#L90
(from Light Software Center)
Regards,
    Matthias

----
[1]: http://listaller.tenstral.net

2012/7/27 tomw <tomw ubilix com>:
Hi,

trying to write some PackageKit code I came across the issue to get
results from an async call like:

pk_task.get_updates_async (filter,
                            null,
                            on_progress,
                            on_ready
                           );

and the respective callback:

private void on_ready () {
     PackageKit.Results? result = null;
     result = pk_task.generic_finish (???);
}

However, the generic_finish method requires an AsyncResult which should
be passed to the callback but I have not found a way to get access to
it? Any suggestions?


Thanks



--
tomw <tomw ubilix com>

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list


Hey! that snippet is mine XD! check out launchpad.net/libappstore for an updated version (though the light-software-center version is simpler).

Stephen Smally



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]