[Vala] GDBus doubt



Hi all:

(I rewrote the message to try to preserve the code format)

I want to use the freedesktop portal DBus interface (https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.OpenURI.xml) to open a file with another application. I created this test code:

usingGLib;

// using GIO;

usingPosix;

intmain(string[] args) {

varloop =newGLib.MainLoop();

vardbus_connection =Bus.get_sync(BusType.SESSION);

varfichero =Posix.open(args[1], Posix.O_RDONLY, 0);

varfdList =newGLib.UnixFDList();

fdList.append(fichero);

varbuilder =newVariantBuilder(newVariantType("(a{sv})"));

varinParameters =builder.end();

varparameters =newGLib.Variant("(sha{sv})", "0", 0, inParameters);

dbus_connection.call_with_unix_fd_list_sync("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", "org.freedesktop.portal.OpenURI", "OpenFile", parameters, newGLib.VariantType("(o)"), DBusCallFlags.NONE, 100000,fdList);

loop.run();

return0;

}



It works, but when I do "varinParameters =builder.end();" I receive these messages:

(process:8011): GLib-CRITICAL **: 22:00:26.531: g_variant_builder_end: assertion 'GVSB(builder)->offset >= GVSB(builder)->min_items' failed

(process:8011): GLib-CRITICAL **: 22:00:26.531: g_variant_ref_sink: assertion 'value != NULL' failed

Where is my error?

Thanks.

--
Nos leemos
                         RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.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]