From 61d1d7df6fbb946d5f8ead5e529e5d319dbf7224 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Sun, 1 Sep 2019 23:02:46 +0300 Subject: [PATCH 1/3] sendto plugin: move g_file_info_get_content_type() call out of the cycle Signed-off-by: Sergey Ponomarev --- plugins/thunar-sendto-email/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/thunar-sendto-email/main.c b/plugins/thunar-sendto-email/main.c index 23b8c14a..9b212b14 100644 --- a/plugins/thunar-sendto-email/main.c +++ b/plugins/thunar-sendto-email/main.c @@ -163,12 +163,11 @@ tse_ask_compress (GList *infos) if (g_file_info_get_file_type (tse_data->info) == G_FILE_TYPE_DIRECTORY) return TSE_RESPONSE_COMPRESS; + /* determine the content type */ + content_type = g_file_info_get_content_type (tse_data->info); /* check if the single file is already an archive */ for (n = 0; n < G_N_ELEMENTS (TSE_MIME_TYPES); ++n) { - /* determine the content type */ - content_type = g_file_info_get_content_type (tse_data->info); - /* check if this mime type matches */ if (content_type != NULL && g_content_type_is_a (content_type, TSE_MIME_TYPES[n])) { @@ -183,7 +182,7 @@ tse_ask_compress (GList *infos) } /* check if the total size is larger than 200KiB, or we have more than - * one file, and atleast one of the files is not already an archive. + * one file, and at least one of the files is not already an archive. */ if ((n_infos > 1 || total_size > 200 * 1024) && n_infos != n_archives) { -- 2.20.1