Re: [Vala] Getting results from an async callback



Well, libappstore is cross distro, because it uses packagekit. The app database is built using app-install, and if is not present using the packagekit datas (there is a build_fallback function, currently works but doesn't give good results).

Il 28/07/2012 13:37, Matthias Klumpp ha scritto:
The number of people working on similar stuff with similar tools is
really, really small! :D I know Stephen from a bug report against
PackageKit and you from the PackageKit ML :-)
For Listaller, we need sync calls because PackageKit uses sync calls
internally and Listaller is plugged into PackageKit to perform
software-management tasks as root. So you'll find some unusual ways to
call PackageKit for unusual tasks there. (but most conceps can be
easily applied to other projects, I'm also thinking if a async API
would make sense for frontend developers. (LI frontends are integrated
into PK frontends and Software-Centers (usually only a few new lines
of code are needed to support non-root installations if PK is already
used) - for GNOME-PackageKit having async API would be good...)
Having a "libappstore" is imho a very good idea, I also thought of
writing that lib later (I am busy with PackageKit, AppStream and the
Ubuntu Software Center at time) - Are you doing that lib
cross-distributional? (Very important for me ^^)
@list: Sorry for the OT
Cheers,
    Matthias

2012/7/27 tomw <tomw ubilix com>:
On Fr, 2012-07-27 at 17:34 +0200, Matthias Klumpp wrote:
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

Thanks, I'm using Listaller 0.5.5 as a reference quite a lot. However,
for that part you are using mainly the synchronous calls.
Passing user data in a closure will do the trick.

--
tomw <tomw ubilix com>

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





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