[evince/wip/bug654832: 3/18] Revert "Improve mime type detection on win32"
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/bug654832: 3/18] Revert "Improve mime type detection on win32"
- Date: Wed, 9 May 2012 17:52:18 +0000 (UTC)
commit d109a48a25d45037ab211f28f41b7f2ee22992ec
Author: Christian Persch <chpe gnome org>
Date: Wed May 9 17:49:31 2012 +0200
Revert "Improve mime type detection on win32"
This reverts commit 7802664fef53b83c32548e2f477083cc47ee06cc.
libdocument/ev-file-helpers.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index 47a9738..91aafc2 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -493,6 +493,7 @@ get_mime_type_from_uri (const gchar *uri, GError **error)
static gchar *
get_mime_type_from_data (const gchar *uri, GError **error)
{
+#ifndef G_OS_WIN32
GFile *file;
GFileInputStream *input_stream;
gssize size_read;
@@ -529,19 +530,16 @@ get_mime_type_from_data (const gchar *uri, GError **error)
if (!content_type)
return NULL;
-#ifdef G_OS_WIN32
- /* On Windows, the implementation of g_content_type_guess() is
- * sometimes too limited, so we do use get_mime_type_from_uri()
- * as a fallback */
- if (strcmp (content_type, "*") == 0) {
- g_free (content_type);
- return get_mime_type_from_uri (uri, error);
- }
-#endif /* G_OS_WIN32 */
-
mime_type = g_content_type_get_mime_type (content_type);
g_free (content_type);
return mime_type;
+#else
+ /*
+ * On Windows, the implementation of g_content_type_guess() is too limited at the moment, so we do not
+ * use it and fall back to get_mime_type_from_uri()
+ */
+ return get_mime_type_from_uri (uri, error);
+#endif /* G_OS_WIN32 */
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]