[vala/wip/dbusgen: 394/403] dbusgen: Add mandatory "throws DBusError, IOError" to methods




commit dc2af69fed91364d05e19886c063cd56c7c1c8ef
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Sep 19 15:07:00 2018 +0200

    dbusgen: Add mandatory "throws DBusError, IOError" to methods

 dbusgen/valadbusparser.vala        | 2 ++
 dbusgen/valadbusvariantmodule.vala | 4 ++++
 2 files changed, 6 insertions(+)
---
diff --git a/dbusgen/valadbusparser.vala b/dbusgen/valadbusparser.vala
index 612f30cf9..08450d90a 100644
--- a/dbusgen/valadbusparser.vala
+++ b/dbusgen/valadbusparser.vala
@@ -298,6 +298,8 @@ public class Vala.DBusParser : CodeVisitor {
                current_iface.add_method ((Method)current_method);
                ((Method)current_method).is_abstract = true;
                ((Method)current_method).access = SymbolAccessibility.PUBLIC;
+               ((Method)current_method).add_error_type (dbus_module.gio_error_type);
+               ((Method)current_method).add_error_type (dbus_module.gdbus_error_type);
 
                next ();
 
diff --git a/dbusgen/valadbusvariantmodule.vala b/dbusgen/valadbusvariantmodule.vala
index 578c76b24..df69a2c15 100644
--- a/dbusgen/valadbusvariantmodule.vala
+++ b/dbusgen/valadbusvariantmodule.vala
@@ -49,6 +49,8 @@ public class Vala.DBusVariantModule {
        public TypeSymbol gtype_type;
        public TypeSymbol gobject_type;
        public ErrorType gerror_type;
+       public ErrorType gdbus_error_type;
+       public ErrorType gio_error_type;
        public ObjectType dictionary_type;
        public ObjectType gvariant_type;
        public Struct gvalue_type;
@@ -90,6 +92,8 @@ public class Vala.DBusVariantModule {
                gtype_type = (TypeSymbol) glib_ns.scope.lookup ("Type");
                gobject_type = (TypeSymbol) glib_ns.scope.lookup ("Object");
                gerror_type = new ErrorType (null, null);
+               gio_error_type = new ErrorType ((ErrorDomain) glib_ns.scope.lookup ("DBusError"), null);
+               gdbus_error_type = new ErrorType ((ErrorDomain) glib_ns.scope.lookup ("IOError"), null);
 
                gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
                gvariant_type = new ObjectType ((Class) glib_ns.scope.lookup ("Variant"));


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