[vala/mjog/glib_tz_identifier] glib-2.0: Fix GLib.TimeZone.identifier not nullable




commit 7a30c15adc0b027cf93b1d4ee942cdb8398a386a
Author: Michael James Gratton <mike vee net>
Date:   Tue Apr 6 13:56:23 2021 +1000

    glib-2.0: Fix GLib.TimeZone.identifier not nullable
    
    Since g_time_zone_new_identifier can return null, deprecate
    ctor and replace it with a static factory method.

 vapi/glib-2.0.vapi | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 65ba798cc..8c129a157 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -3288,7 +3288,7 @@ namespace GLib {
        public class TimeZone {
                [Version (deprecated = true, deprecated_since = "2.68", replacement = "TimeZone.identifier")]
                public TimeZone (string identifier);
-               [Version (since = "2.68")]
+               [Version (deprecated = true, deprecated_since = "2.68", replacement = 
"TimeZone.new_from_identifier")]
                public TimeZone.identifier (string identifier);
                public TimeZone.utc ();
                public TimeZone.local ();
@@ -3301,6 +3301,10 @@ namespace GLib {
                public unowned string get_identifier ();
                public int32 get_offset (int interval);
                public bool is_dst (int interval);
+
+               [CCode (cname = "g_time_zone_new_identifier")]
+               [Version (since = "2.68")]
+               public static TimeZone? new_from_identifier (string identifier);
        }
 
        /* Random Numbers */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]