]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Add flags parameter to get_proxy_sync methods
authorJürg Billeter <j@bitron.ch>
Wed, 20 Oct 2010 20:48:16 +0000 (22:48 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 20 Oct 2010 20:51:36 +0000 (22:51 +0200)
This also changes the default flags to DBusProxyFlags.NONE, which
enables property caching.

Fixes bug 631228.

codegen/valagdbusclientmodule.vala
tests/dbus/arrays.test
tests/dbus/basic-types.test
tests/dbus/structs.test
vapi/gio-2.0.vapi
vapi/packages/gio-2.0/gio-2.0-custom.vala

index 53021958a214f28d36b767aca2e097d085ba0792..433303446b0aa7de62fffd4d83b42819b7b54cf3 100644 (file)
@@ -222,7 +222,8 @@ public class Vala.GDBusClientModule : GDBusModule {
                var args = expr.get_argument_list ();
                Expression name = args.get (base_arg_index + 0);
                Expression object_path = args.get (base_arg_index + 1);
-               Expression cancellable = args.get (base_arg_index + 2);
+               Expression flags = args.get (base_arg_index + 2);
+               Expression cancellable = args.get (base_arg_index + 3);
 
                // method can fail
                current_method_inner_error = true;
@@ -233,7 +234,7 @@ public class Vala.GDBusClientModule : GDBusModule {
                ccall.add_argument (get_cvalue (cancellable));
                ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression ("_inner_error_")));
                ccall.add_argument (new CCodeConstant ("\"g-flags\""));
-               ccall.add_argument (new CCodeConstant ("G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES"));
+               ccall.add_argument (get_cvalue (flags));
                ccall.add_argument (new CCodeConstant ("\"g-name\""));
                name.emit (this);
                ccall.add_argument (get_cvalue (name));
index fd52c323fa4eb77adef81698eddf6269d026ee21..fa884ca24b08c3c4a2a17c7ff26e4591ff2b2f5e 100644 (file)
@@ -13,7 +13,7 @@ interface Test : Object {
 
 void main () {
        // client
-       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test");
+       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test", DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
 
        int[] j, k;
        k = test.test_int ({ 42 }, out j);
index e6366be5b8d309674c222acb3598335f1a12ddb2..9b183f74cbbddd11275c8272872bb7dab6148c15 100644 (file)
@@ -14,7 +14,7 @@ interface Test : Object {
 
 void main () {
        // client
-       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test");
+       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test", DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
 
        test.test_void ();
 
index 73311ca6b896b4971431a41f24bc15fbf545aad6..d23dd84b81c835a221df0b687bbc93e1f9eec39d 100644 (file)
@@ -22,7 +22,7 @@ interface Test : Object {
 
 void main () {
        // client
-       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test");
+       Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test", DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
 
        FooStruct f, g, h;
        f = FooStruct (42, "hello");
index 9ca68066e1a82af20bd6f6541dbe231a37552308..8283164e5169297e2a433827cac6541ec2c8b550 100644 (file)
@@ -7,7 +7,7 @@ namespace GLib {
                [CCode (cheader_filename = "gio/gio.h")]
                public static async GLib.DBusConnection @get (GLib.BusType bus_type, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                [CCode (cheader_filename = "gio/gio.h")]
-               public static T get_proxy_sync<T> (GLib.BusType bus_type, string name, string object_path, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public static T get_proxy_sync<T> (GLib.BusType bus_type, string name, string object_path, GLib.DBusProxyFlags flags = 0, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                [CCode (cheader_filename = "gio/gio.h")]
                public static GLib.DBusConnection get_sync (GLib.BusType bus_type, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                [CCode (cname = "g_bus_own_name_with_closures", cheader_filename = "gio/gio.h")]
@@ -200,7 +200,7 @@ namespace GLib {
                public bool get_exit_on_close ();
                public unowned string get_guid ();
                public unowned GLib.Credentials get_peer_credentials ();
-               public T get_proxy_sync<T> (string? name, string object_path, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public T get_proxy_sync<T> (string? name, string object_path, GLib.DBusProxyFlags flags = 0, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                public unowned GLib.IOStream get_stream ();
                public unowned string get_unique_name ();
                public bool is_closed ();
index 0517e4c1f26b88ece29e9436449f743c27ae6a10..ed214fe68c2bd8bfcea30110b2a635cbf14acd42 100644 (file)
@@ -56,7 +56,7 @@ namespace GLib {
        namespace Bus {
                public async GLib.DBusConnection get (GLib.BusType bus_type, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                public GLib.DBusConnection get_sync (GLib.BusType bus_type, GLib.Cancellable? cancellable = null) throws GLib.IOError;
-               public T get_proxy_sync<T> (GLib.BusType bus_type, string name, string object_path, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public T get_proxy_sync<T> (GLib.BusType bus_type, string name, string object_path, GLib.DBusProxyFlags flags = 0, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                [CCode (cname = "g_bus_own_name_with_closures")]
                public uint own_name (GLib.BusType bus_type, string name, GLib.BusNameOwnerFlags flags, [CCode (type = "GClosure*")] owned GLib.BusAcquiredCallback bus_acquired_handler, [CCode (type = "GClosure*")] owned GLib.BusNameAcquiredCallback name_acquired_handler, [CCode (type = "GClosure*")] owned GLib.BusNameLostCallback name_lost_handler);
                [CCode (cname = "g_bus_own_name_on_connection_with_closures")]
@@ -71,7 +71,7 @@ namespace GLib {
 
        [CCode (cname = "GDBusConnection")]
        public class DBusConnection {
-               public T get_proxy_sync<T> (string? name, string object_path, GLib.Cancellable? cancellable = null) throws GLib.IOError;
+               public T get_proxy_sync<T> (string? name, string object_path, GLib.DBusProxyFlags flags = 0, GLib.Cancellable? cancellable = null) throws GLib.IOError;
                public uint register_object<T> (string object_path, T object) throws GLib.IOError;
        }
 }