Files
MINGW-packages/mingw-w64-eog/005-content-type-to-mime-type-conversion.patch
2021-11-03 20:07:09 +03:00

172 lines
6.3 KiB
Diff

From e1611621ba419e2f6034606e6615077bb920a4fc Mon Sep 17 00:00:00 2001
From: Doronin Stanislav <mugisbrows@gmail.com>
Date: Wed, 3 Nov 2021 17:22:57 +0300
Subject: [PATCH] content type to mime type conversion
---
src/eog-image.c | 3 ++-
src/eog-jobs.c | 3 ++-
src/eog-list-store.c | 15 ++++++++++-----
src/eog-metadata-sidebar.c | 3 ++-
src/eog-properties-dialog.c | 3 ++-
src/eog-thumb-view.c | 3 ++-
src/eog-thumbnail.c | 3 ++-
src/eog-window.c | 3 ++-
8 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/eog-image.c b/src/eog-image.c
index f57243d..ff99719 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -628,7 +628,8 @@ eog_image_get_file_info (EogImage *img,
*bytes = g_file_info_get_size (file_info);
if (mime_type)
- *mime_type = g_strdup (g_file_info_get_content_type (file_info));
+ *mime_type = g_strdup (g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info)));
g_object_unref (file_info);
}
}
diff --git a/src/eog-jobs.c b/src/eog-jobs.c
index c1813b2..3b75d67 100644
--- a/src/eog-jobs.c
+++ b/src/eog-jobs.c
@@ -757,7 +757,8 @@ filter_files (GSList *files, GList **file_list, GList **error_list)
if (G_UNLIKELY (type == G_FILE_TYPE_UNKNOWN)) {
const gchar *ctype;
- ctype = g_file_info_get_content_type (file_info);
+ ctype = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
/* If the content type is supported
adjust the file_type */
diff --git a/src/eog-list-store.c b/src/eog-list-store.c
index a711281..de89789 100644
--- a/src/eog-list-store.c
+++ b/src/eog-list-store.c
@@ -391,7 +391,8 @@ file_monitor_changed_cb (GFileMonitor *monitor,
if (file_info == NULL) {
break;
}
- mimetype = g_file_info_get_content_type (file_info);
+ mimetype = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
if (is_file_in_list_store_file (store, file, &iter)) {
if (eog_image_is_supported_mime_type (mimetype)) {
@@ -434,7 +435,8 @@ file_monitor_changed_cb (GFileMonitor *monitor,
if (file_info == NULL) {
break;
}
- mimetype = g_file_info_get_content_type (file_info);
+ mimetype = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
if (eog_image_is_supported_mime_type (mimetype)) {
const gchar *caption;
@@ -452,7 +454,8 @@ file_monitor_changed_cb (GFileMonitor *monitor,
if (file_info == NULL) {
break;
}
- mimetype = g_file_info_get_content_type (file_info);
+ mimetype = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
if (is_file_in_list_store_file (store, file, &iter) &&
eog_image_is_supported_mime_type (mimetype)) {
eog_list_store_thumbnail_refresh (store, &iter);
@@ -484,7 +487,8 @@ directory_visit (GFile *directory,
gboolean load_uri = FALSE;
const char *mime_type, *name;
- mime_type = g_file_info_get_content_type (children_info);
+ mime_type = g_content_type_get_mime_type (
+ g_file_info_get_content_type (children_info));
name = g_file_info_get_name (children_info);
if (!g_str_has_prefix (name, ".")) {
@@ -592,7 +596,8 @@ eog_list_store_add_files (EogListStore *store, GList *file_list)
if (G_UNLIKELY (file_type == G_FILE_TYPE_UNKNOWN)) {
const gchar *ctype;
- ctype = g_file_info_get_content_type (file_info);
+ ctype = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
/* If the content type is supported adjust file_type */
if (eog_image_is_supported_mime_type (ctype))
diff --git a/src/eog-metadata-sidebar.c b/src/eog-metadata-sidebar.c
index 010db48..4195bb9 100644
--- a/src/eog-metadata-sidebar.c
+++ b/src/eog-metadata-sidebar.c
@@ -156,7 +156,8 @@ eog_metadata_sidebar_update_general_section (EogMetadataSidebar *sidebar)
} else {
const gchar *mime_str;
- mime_str = g_file_info_get_content_type (file_info);
+ mime_str = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
str = g_content_type_get_description (mime_str);
g_object_unref (file_info);
}
diff --git a/src/eog-properties-dialog.c b/src/eog-properties-dialog.c
index 5ce7bfb..f3a57fa 100644
--- a/src/eog-properties-dialog.c
+++ b/src/eog-properties-dialog.c
@@ -181,7 +181,8 @@ pd_update_general_tab (EogPropertiesDialog *prop_dlg,
if (file_info == NULL) {
type_str = g_strdup (_("Unknown"));
} else {
- mime_str = g_file_info_get_content_type (file_info);
+ mime_str = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
type_str = g_content_type_get_description (mime_str);
g_object_unref (file_info);
}
diff --git a/src/eog-thumb-view.c b/src/eog-thumb-view.c
index 6493f17..e84ac06 100644
--- a/src/eog-thumb-view.c
+++ b/src/eog-thumb-view.c
@@ -495,7 +495,8 @@ thumbview_get_tooltip_string (EogImage *image)
return NULL;
}
- mime_str = g_file_info_get_content_type (file_info);
+ mime_str = g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
if (G_UNLIKELY (mime_str == NULL)) {
g_free (bytes);
diff --git a/src/eog-thumbnail.c b/src/eog-thumbnail.c
index 5e5eeea..b0dbbfc 100644
--- a/src/eog-thumbnail.c
+++ b/src/eog-thumbnail.c
@@ -181,7 +181,8 @@ eog_thumb_data_new (GFile *file, GError **error)
/* if available, copy data */
data->mtime = g_file_info_get_attribute_uint64 (file_info,
G_FILE_ATTRIBUTE_TIME_MODIFIED);
- data->mime_type = g_strdup (g_file_info_get_content_type (file_info));
+ data->mime_type = g_strdup (g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info)));
data->failed_thumb_exists = g_file_info_get_attribute_boolean (file_info,
G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
diff --git a/src/eog-window.c b/src/eog-window.c
index 1d0ffe4..1b783a2 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -842,7 +842,8 @@ add_file_to_recent_files (GFile *file)
recent_data = g_slice_new (GtkRecentData);
recent_data->display_name = NULL;
recent_data->description = NULL;
- recent_data->mime_type = (gchar *) g_file_info_get_content_type (file_info);
+ recent_data->mime_type = (gchar *) g_content_type_get_mime_type (
+ g_file_info_get_content_type (file_info));
recent_data->app_name = EOG_RECENT_FILES_APP_NAME;
recent_data->app_exec = g_strjoin(" ", g_get_prgname (), "%u", NULL);
recent_data->groups = groups;
--
2.33.0