]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Wrap TimeZone.identifier() constuctor for proper error support
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 7 Apr 2021 16:14:16 +0000 (18:14 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 19 Apr 2021 19:36:28 +0000 (21:36 +0200)
This allows to handle possible null returned by this constructor.

vapi/glib-2.0.vapi

index 0c605b3e54d843d8ec32db8c9d567ac7533f7b84..9bf3156e87febff9f0f53c425d64f018473a1d30 100644 (file)
@@ -3288,8 +3288,16 @@ namespace GLib {
        public class TimeZone {
                [Version (deprecated = true, deprecated_since = "2.68", replacement = "TimeZone.identifier")]
                public TimeZone (string identifier);
+               [CCode (cname = "g_time_zone_new_identifier")]
+               TimeZone.new_identifier (string? identifier);
                [Version (since = "2.68")]
-               public TimeZone.identifier (string identifier);
+               [CCode (cname = "vala_g_time_zone_new_identifier")]
+               public TimeZone.identifier (string? identifier) throws Error {
+                       this.new_identifier (identifier);
+                       if ((TimeZone?) this == null) {
+                               throw new ConvertError.ILLEGAL_SEQUENCE ("Invalid identifier argument");
+                       }
+               }
                public TimeZone.utc ();
                public TimeZone.local ();
                [Version (since = "2.58")]