]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support [DBus (visible = false)] for methods, properties, and signals,
authorJuerg Billeter <j@bitron.ch>
Fri, 23 May 2008 19:25:16 +0000 (19:25 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 23 May 2008 19:25:16 +0000 (19:25 +0000)
2008-05-23  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodeclassbinding.vala:

Support [DBus (visible = false)] for methods, properties, and
signals, based on patch by Ali Sabil, fixes bug 532254

svn path=/trunk/; revision=1412

ChangeLog
gobject/valaccodeclassbinding.vala

index 27946e9b1fddd9f441d61ed83af12e19af9d7638..18a3d78d3f41af5d9a638a554e11e08398a04ee4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-23  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodeclassbinding.vala:
+
+       Support [DBus (visible = false)] for methods, properties, and
+       signals, based on patch by Ali Sabil, fixes bug 532254
+
 2008-05-23  Jürg Billeter  <j@bitron.ch>
 
        * vapi/dbus-glib-1.vapi: add DBus.ObjectPath class
index 28c73d00d33337f1de9576afb09ba027ba65fdb7..2c0d8fa920dbfc684906e3b05bbac4d640a33347 100644 (file)
@@ -743,6 +743,17 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                return new CCodeExpressionStatement (cwarn);
        }
 
+       bool is_dbus_visible (CodeNode node) {
+               var dbus_attribute = node.get_attribute ("DBus");
+               if (dbus_attribute != null
+                   && dbus_attribute.has_argument ("visible")
+                   && !dbus_attribute.get_bool ("visible")) {
+                       return false;
+               }
+
+               return true;
+       }
+
        void register_dbus_info () {
                var dbus = cl.get_attribute ("DBus");
                if (dbus == null) {
@@ -768,6 +779,9 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                            || m.overrides || m.access != SymbolAccessibility.PUBLIC) {
                                continue;
                        }
+                       if (!is_dbus_visible (m)) {
+                               continue;
+                       }
 
                        var parameters = new Gee.ArrayList<FormalParameter> ();
                        foreach (FormalParameter param in m.get_parameters ()) {
@@ -860,6 +874,9 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                        if (sig.access != SymbolAccessibility.PUBLIC) {
                                continue;
                        }
+                       if (!is_dbus_visible (sig)) {
+                               continue;
+                       }
 
                        dbus_signals.append (dbus_iface_name);
                        dbus_signals.append ("\\0");
@@ -874,6 +891,9 @@ public class Vala.CCodeClassBinding : CCodeTypesymbolBinding {
                        if (prop.access != SymbolAccessibility.PUBLIC) {
                                continue;
                        }
+                       if (!is_dbus_visible (prop)) {
+                               continue;
+                       }
 
                        dbus_props.append (dbus_iface_name);
                        dbus_props.append ("\\0");