[vala] glib-2.0, gio-2.0: Fix some nullable types in ContentType, Icon, HashTable



commit b2b17a15566d744956ddfdabc656e751650cf9bc
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Dec 22 00:10:18 2011 +0000

    glib-2.0, gio-2.0: Fix some nullable types in ContentType, Icon, HashTable
    
    Fixes bug 666699.

 vapi/gio-2.0.vapi                         |   10 +++++-----
 vapi/glib-2.0.vapi                        |    4 ++--
 vapi/packages/gio-2.0/gio-2.0-custom.vala |    4 ++--
 vapi/packages/gio-2.0/gio-2.0.metadata    |    4 +++-
 4 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index df9c2b1..2978484 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")]
@@ -2171,7 +2171,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 ();
@@ -3126,7 +3126,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);
@@ -3135,7 +3135,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 a947553..39274d3 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -3914,7 +3914,7 @@ namespace GLib {
 		public HashTable.full (HashFunc<K>? hash_func, EqualFunc<K>? 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 ();
@@ -3927,7 +3927,7 @@ namespace GLib {
 		public void @foreach (HFunc<K,V> func);
 		[CCode (cname = "g_hash_table_foreach")]
 		public void for_each (HFunc<K,V> func);
-		public unowned V find (HRFunc<K,V> predicate);
+		public unowned V? find (HRFunc<K,V> 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 f36fb42..d35d95f 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 8d5a94d..e7581ae 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"



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