When user selects few files to send then internally sendto checks that all files are already archives and if not it shows a dialog window to ask to compress the files (see tse_ask_compress function). The content type is checked on the line plugins/thunar-sendto-email/main.c:170 /* determine the content type */ content_type = g_file_info_get_content_type (tse_data->info); The problem that the content_type is always resolved to NULL so in fact it never detects archives and always asks to compress multiple files even if they are already compressed. Steps to Reproduce: 1. create two text files and compress them: $ cd ~/ $ touch hello1.txt $ touch hello2.txt $ gzip -k hello1.txt $ gzip -k hello2.txt $ ls hello1.txt hello1.txt.gz hello2.txt hello2.txt.gz 2. Run Thunar's sendto-email and send the two gzipped files: /usr/local/lib/Thunar/thunar-sendto-email hello1.txt.gz hello2.txt.gz Expected Results: Files are just attached. Actual Results: A dialog shown "Send 2 files as compressed archive?" I'll attach patches with the fix and small refactoring as comments because I don't now how to attach multiple patch files: But you can also see it on github https://github.com/stokito/thunar/tree/sendto_fix_content_type
Created attachment 8980 refactoring
Created attachment 8981 0002-sendto-plugin-extract-function-tse_file_is_archive.patch
Created attachment 8982 actual fix
Thanks for the patches ! They fix the bug and look fine for me ! > .. because I don't now how to attach multiple patch files: git format-patch -3 --stdout > multi_commit.patch I'll push them to 4.14 branch and master
Sergey Ponomarev referenced this bugreport in commit 0c74c71708f0736b397713ddc7d574445e380953 sendto plugin: move g_file_info_get_content_type() call out of the cycle (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=0c74c71708f0736b397713ddc7d574445e380953
Sergey Ponomarev referenced this bugreport in commit 3ecc5abcf76251795944b8050c302326995584fe sendto plugin: extract function tse_file_is_archive (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=3ecc5abcf76251795944b8050c302326995584fe
Sergey Ponomarev referenced this bugreport in commit e4d2d218a58601a6272262a3a604aaeecd6aa2cc sendto plugin: fix content type resolution. (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=e4d2d218a58601a6272262a3a604aaeecd6aa2cc
Sergey Ponomarev referenced this bugreport in commit 57fa316d24ced0cbc6536469700a45697b5893aa sendto plugin: move g_file_info_get_content_type() call out of the cycle (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=57fa316d24ced0cbc6536469700a45697b5893aa
Sergey Ponomarev referenced this bugreport in commit a74764160cd34f2a8669f6fe9a25967439e53aa8 sendto plugin: extract function tse_file_is_archive (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=a74764160cd34f2a8669f6fe9a25967439e53aa8
Sergey Ponomarev referenced this bugreport in commit a432b8dd6800cbc3331d54511c56b444fd4fafa9 sendto plugin: fix content type resolution. (Bug #15916) https://git.xfce.org/xfce/thunar/commit?id=a432b8dd6800cbc3331d54511c56b444fd4fafa9
Tnank you. I had ad idea that it is possible to have multiple commits in a single patch file but I wasn't unable to google this so decided that this is not possible. It also would be nice to add the multi commit patch to the guide https://docs.xfce.org/contribute/dev/git/start I did everything by the guide. But to be honest I spent twice more time to prepare the patch and create the ticket in Bugzilla then actual fix. I'm not so expirienced developer but I did a lot of contribution just on GitHub and for me it's more convinent and clear. If XFCE project had concideration to move to GitHub or self hosted GitLab then this will much more simplify contribution for those like me.
> It also would be nice to add the multi commit patch to the guide Good idea .. done Our Infra plans to move to a self hosted gitlab soon .. hope till end of the year. We will see. (Besides that, there is a github mirror: https://github.com/xfce-mirror .. though I dont know if everybody can open pull requests there)