[Xfce-bugs] [Bug 15916] New: BUG: Thunar SendTo Email doesn't detects files that are already archives

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Mon Sep 2 14:44:06 CEST 2019


https://bugzilla.xfce.org/show_bug.cgi?id=15916

            Bug ID: 15916
           Summary: BUG: Thunar SendTo Email doesn't detects files that
                    are already archives
    Classification: Xfce Core
           Product: Thunar
           Version: git
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: General
          Assignee: xfce-bugs at xfce.org
          Reporter: stokito at gmail.com
  Target Milestone: 1.8.10

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

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list