[vala/0.40] vala: Report an error if gio-2.0 is missing for DBus support
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] vala: Report an error if gio-2.0 is missing for DBus support
- Date: Sun, 3 Jan 2021 12:46:52 +0000 (UTC)
commit ce4ec9333f975a22b02d7b2ed2977fcfc18c8763
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Dec 3 19:44:06 2020 +0100
vala: Report an error if gio-2.0 is missing for DBus support
vala/valaclass.vala | 4 ++++
vala/valainterface.vala | 4 ++++
vala/valaobjecttypesymbol.vala | 13 +++++++++++++
3 files changed, 21 insertions(+)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 532acc19d..83e8e8d85 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -502,6 +502,10 @@ public class Vala.Class : ObjectTypeSymbol {
return !error;
}
+ if (!base.check (context)) {
+ return false;
+ }
+
checked = true;
var old_source_file = context.analyzer.current_source_file;
diff --git a/vala/valainterface.vala b/vala/valainterface.vala
index 5ee995135..cdce3ca38 100644
--- a/vala/valainterface.vala
+++ b/vala/valainterface.vala
@@ -202,6 +202,10 @@ public class Vala.Interface : ObjectTypeSymbol {
return !error;
}
+ if (!base.check (context)) {
+ return false;
+ }
+
checked = true;
var old_source_file = context.analyzer.current_source_file;
diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala
index f91c6ba5d..c355a4474 100644
--- a/vala/valaobjecttypesymbol.vala
+++ b/vala/valaobjecttypesymbol.vala
@@ -304,4 +304,17 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol {
scope.add (null, m);
}
+
+ public override bool check (CodeContext context) {
+ if (checked) {
+ return !error;
+ }
+
+ if (!external_package && get_attribute ("DBus") != null && !context.has_package ("gio-2.0")) {
+ error = true;
+ Report.error (source_reference, "gio-2.0 package required for DBus support");
+ }
+
+ return !error;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]