[vala/wip/dbusgen: 144/152] dbusgen: Add mandatory "throws DBusError, IOError" to methods
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/dbusgen: 144/152] dbusgen: Add mandatory "throws DBusError, IOError" to methods
- Date: Mon, 4 Feb 2019 09:13:17 +0000 (UTC)
commit 9ec64d13446d7fc4d8c51392afcd3ad5665be639
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 d89eae4be..b97b464be 100644
--- a/dbusgen/valadbusparser.vala
+++ b/dbusgen/valadbusparser.vala
@@ -300,6 +300,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]