]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support nullable error types in VAPI files
authorJürg Billeter <j@bitron.ch>
Thu, 18 Feb 2010 22:02:27 +0000 (23:02 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 18 Feb 2010 22:02:27 +0000 (23:02 +0100)
vala/valaerrortype.vala

index d0992e85c52d4deca62155f804432f60ccd132e6..a21a323a3fa06ab34f30ecbb60f9967f3a999cfe 100644 (file)
@@ -1,6 +1,6 @@
 /* valaerrortype.vala
  *
- * Copyright (C) 2008  Jürg Billeter
+ * Copyright (C) 2008-2010  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -77,11 +77,19 @@ public class Vala.ErrorType : ReferenceType {
        }
 
        public override string to_qualified_string (Scope? scope) {
+               string result;
+
                if (error_domain == null) {
-                       return "GLib.Error";
+                       result = "GLib.Error";
                } else {
-                       return error_domain.get_full_name ();
+                       result = error_domain.get_full_name ();
+               }
+
+               if (nullable) {
+                       result += "?";
                }
+
+               return result;
        }
 
        public override DataType copy () {