summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-08-26 12:48:38 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2017-08-26 12:48:38 +0200
commitb5ed9220cfa0927c22aa3ed0b8a038d23495fdd8 (patch)
tree74dbc2f303180f1902b7625e6b3191a86c0a8018
parent3bcfd0be082b7f6317b7eeebc899a1885840036d (diff)
downloadvala-b5ed9220cfa0927c22aa3ed0b8a038d23495fdd8.tar.gz
girparser: Better support of "cprefix" argument in metadata
-rw-r--r--vala/valagirparser.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index ff2e3d3d7..f030c08ca 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -715,7 +715,12 @@ public class Vala.GirParser : CodeVisitor {
if (name == null) {
return "";
}
- var prefix = symbol.get_attribute_string ("CCode", "cprefix");
+ string prefix;
+ if (metadata.has_argument (ArgumentType.CPREFIX)) {
+ prefix = metadata.get_string (ArgumentType.CPREFIX);
+ } else {
+ prefix = symbol.get_attribute_string ("CCode", "cprefix");
+ }
if (prefix == null && girdata != null && girdata["c:identifier-prefixes"] != null) {
prefix = girdata["c:identifier-prefixes"];
int idx = prefix.index_of (",");