]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
method: Check with same rules for dbus compatibility as in GBusModule
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 26 Feb 2018 20:10:37 +0000 (21:10 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 26 Feb 2018 20:29:53 +0000 (21:29 +0100)
Only issue warning if the method would actually be end up on DBus as
per generate_interface_method_call_function() or get_method_info().

Based on patch by Corentin Noël

https://bugzilla.gnome.org/show_bug.cgi?id=793859

vala/valamethod.vala

index 133bca52e17d68ab19605efa1e2a4f0250c680a4..a2bd57c45ed6a9cf2e95a3463b78aaedc8b1532a 100644 (file)
@@ -857,7 +857,9 @@ public class Vala.Method : Subroutine, Callable {
                }
 
                // check that DBus methods at least throw "GLib.Error" or "GLib.DBusError, GLib.IOError"
-               if (parent_symbol is ObjectTypeSymbol && parent_symbol.get_attribute ("DBus") != null) {
+               if (!(this is CreationMethod) && binding == MemberBinding.INSTANCE
+                   && !overrides && access == SymbolAccessibility.PUBLIC
+                   && parent_symbol is ObjectTypeSymbol && parent_symbol.get_attribute ("DBus") != null) {
                        Attribute? dbus_attr = get_attribute ("DBus");
                        if (dbus_attr == null || dbus_attr.get_bool ("visible", true)) {
                                bool throws_gerror = false;