[glib] Implement g_content_type_is_mime_type() (clone of win32's)
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Implement g_content_type_is_mime_type() (clone of win32's)
- Date: Fri, 28 Apr 2017 10:37:52 +0000 (UTC)
commit ea586b47a306a1e9b5edd6fc94eb872342a87024
Author: Daniel Macks <dmacks netspace org>
Date: Mon Apr 24 01:52:27 2017 -0400
Implement g_content_type_is_mime_type() (clone of win32's)
Add missing function, copying from gcontenttype-win32.c per Patrick
Griffis (Comment #55 of bug report)
https://bugzilla.gnome.org/show_bug.cgi?id=734946
gio/gosxcontenttype.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gio/gosxcontenttype.c b/gio/gosxcontenttype.c
index 3c223d6..8c15ec7 100644
--- a/gio/gosxcontenttype.c
+++ b/gio/gosxcontenttype.c
@@ -133,6 +133,23 @@ g_content_type_is_a (const gchar *ctype,
}
gboolean
+g_content_type_is_mime_type (const gchar *type,
+ const gchar *mime_type)
+{
+ gchar *content_type;
+ gboolean ret;
+
+ g_return_val_if_fail (type != NULL, FALSE);
+ g_return_val_if_fail (mime_type != NULL, FALSE);
+
+ content_type = g_content_type_from_mime_type (mime_type);
+ ret = g_content_type_is_a (type, content_type);
+ g_free (content_type);
+
+ return ret;
+}
+
+gboolean
g_content_type_is_unknown (const gchar *type)
{
g_return_val_if_fail (type != NULL, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]