From: Philip Withnall Date: Thu, 22 Dec 2011 00:10:18 +0000 (+0000) Subject: glib-2.0, gio-2.0: Fix some nullable types in ContentType, Icon, HashTable X-Git-Tag: 0.14.2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61b913d208c04046dd8034d192a60f02bfa851ad;p=thirdparty%2Fvala.git glib-2.0, gio-2.0: Fix some nullable types in ContentType, Icon, HashTable Fixes bug 666699. --- diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index fa9bc6c77..f6095df2e 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -30,13 +30,13 @@ namespace GLib { [CCode (cheader_filename = "gio/gio.h")] public static bool equals (string type1, string type2); [CCode (cheader_filename = "gio/gio.h")] - public static string from_mime_type (string mime_type); + public static string? from_mime_type (string mime_type); [CCode (cheader_filename = "gio/gio.h")] public static string get_description (string type); [CCode (cheader_filename = "gio/gio.h")] public static GLib.Icon get_icon (string type); [CCode (cheader_filename = "gio/gio.h")] - public static string get_mime_type (string type); + public static string? get_mime_type (string type); [CCode (cheader_filename = "gio/gio.h")] public static string guess (string? filename, uchar[]? data, out bool result_uncertain); [CCode (array_length = false, array_null_terminated = true, cheader_filename = "gio/gio.h")] @@ -2012,7 +2012,7 @@ namespace GLib { } [CCode (cheader_filename = "gio/gio.h")] public interface Icon : GLib.Object { - public abstract bool equal (GLib.Icon icon2); + public abstract bool equal (GLib.Icon? icon2); [NoWrapper] public virtual GLib.Icon? from_tokens (string[] tokens, int version) throws GLib.Error; public abstract uint hash (); @@ -2939,7 +2939,7 @@ namespace GLib { public static bool g_content_type_equals (string type1, string type2); [CCode (cheader_filename = "gio/gio.h", cname = "g_content_type_from_mime_type")] [Deprecated (replacement = "GLib.ContentType.from_mime_type", since = "vala-0.12")] - public static string g_content_type_from_mime_type (string mime_type); + public static string? g_content_type_from_mime_type (string mime_type); [CCode (cheader_filename = "gio/gio.h", cname = "g_content_type_get_description")] [Deprecated (replacement = "GLib.ContentType.get_description", since = "vala-0.12")] public static string g_content_type_get_description (string type); @@ -2948,7 +2948,7 @@ namespace GLib { public static GLib.Icon g_content_type_get_icon (string type); [CCode (cheader_filename = "gio/gio.h", cname = "g_content_type_get_mime_type")] [Deprecated (replacement = "GLib.ContentType.get_mime_type", since = "vala-0.12")] - public static string g_content_type_get_mime_type (string type); + public static string? g_content_type_get_mime_type (string type); [CCode (cheader_filename = "gio/gio.h", cname = "g_content_type_guess")] [Deprecated (replacement = "GLib.ContentType.guess", since = "vala-0.12")] public static string g_content_type_guess (string filename, uchar[] data, out bool result_uncertain); diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index ef67fdd0d..a3e6c94fc 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -3904,7 +3904,7 @@ namespace GLib { public HashTable.full (HashFunc? hash_func, EqualFunc? key_equal_func, DestroyNotify? key_destroy_func, DestroyNotify? value_destroy_func); public void insert (owned K key, owned V value); public void replace (owned K key, owned V value); - public unowned V lookup (K key); + public unowned V? lookup (K key); public bool lookup_extended (K lookup_key, out unowned K orig_key, out unowned V value); public bool remove (K key); public void remove_all (); @@ -3917,7 +3917,7 @@ namespace GLib { public void @foreach (HFunc func); [CCode (cname = "g_hash_table_foreach")] public void for_each (HFunc func); - public unowned V find (HRFunc predicate); + public unowned V? find (HRFunc predicate); public uint size (); public bool steal (K key); public void steal_all (); diff --git a/vapi/packages/gio-2.0/gio-2.0-custom.vala b/vapi/packages/gio-2.0/gio-2.0-custom.vala index f36fb421f..d35d95fce 100644 --- a/vapi/packages/gio-2.0/gio-2.0-custom.vala +++ b/vapi/packages/gio-2.0/gio-2.0-custom.vala @@ -84,7 +84,7 @@ namespace GLib { public static bool g_content_type_equals (string type1, string type2); [Deprecated (since = "vala-0.12", replacement = "GLib.ContentType.from_mime_type")] [CCode (cname = "g_content_type_from_mime_type", cheader_filename = "gio/gio.h")] - public static string g_content_type_from_mime_type (string mime_type); + public static string? g_content_type_from_mime_type (string mime_type); [Deprecated (since = "vala-0.12", replacement = "GLib.ContentType.get_description")] [CCode (cname = "g_content_type_get_description", cheader_filename = "gio/gio.h")] public static string g_content_type_get_description (string type); @@ -93,7 +93,7 @@ namespace GLib { public static GLib.Icon g_content_type_get_icon (string type); [Deprecated (since = "vala-0.12", replacement = "GLib.ContentType.get_mime_type")] [CCode (cname = "g_content_type_get_mime_type", cheader_filename = "gio/gio.h")] - public static string g_content_type_get_mime_type (string type); + public static string? g_content_type_get_mime_type (string type); [Deprecated (since = "vala-0.12", replacement = "GLib.ContentType.guess")] [CCode (cname = "g_content_type_guess", cheader_filename = "gio/gio.h")] public static string g_content_type_guess (string filename, uchar[] data, out bool result_uncertain); diff --git a/vapi/packages/gio-2.0/gio-2.0.metadata b/vapi/packages/gio-2.0/gio-2.0.metadata index 5707981d0..81dd7fa31 100644 --- a/vapi/packages/gio-2.0/gio-2.0.metadata +++ b/vapi/packages/gio-2.0/gio-2.0.metadata @@ -25,7 +25,7 @@ GCancellableSourceFunc.cancellable nullable="1" g_cancellable_get_current nullable="1" g_content_type_can_be_executable parent="ContentType" g_content_type_equals parent="ContentType" -g_content_type_from_mime_type parent="ContentType" transfer_ownership="1" +g_content_type_from_mime_type parent="ContentType" transfer_ownership="1" nullable="1" g_content_type_get_* parent="ContentType" transfer_ownership="1" g_content_type_guess* parent="ContentType" transfer_ownership="1" g_content_type_guess.filename nullable="1" @@ -34,6 +34,7 @@ g_content_type_guess.data_size hidden="1" g_content_type_guess.result_uncertain is_out="1" g_content_type_guess_for_tree parent="ContentType" transfer_ownership="1" is_array="1" no_array_length="1" array_null_terminated="1" transfer_ownership="1" g_content_type_is_* parent="ContentType" +g_content_type_get_mime_type parent="ContentType" transfer_ownership="1" nullable="1" g_content_types_get_registered type_arguments="string" transfer_ownership="1" g_converter_convert.inbuf type_name="uint8" is_array="1" array_length_type="gsize" g_converter_convert.inbuf_size hidden="1" @@ -217,6 +218,7 @@ g_icon_to_tokens virtual="1" g_icon_to_tokens.out_version is_out="1" g_icon_hash.icon hidden="1" g_icon_to_string transfer_ownership="1" nullable="1" +g_icon_equal.icon2 nullable="1" g_inet_address_new_from_bytes.bytes type_name="uint8" is_array="1" no_array_length="1" g_inet_address_to_string transfer_ownership="1" g_inet_address_to_bytes type_name="uint8" is_array="1" no_array_length="1"