! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar offers to extract OpenDocument files
Status:
RESOLVED: FIXED
Product:
Thunar-archive-plugin
Component:
General

Comments

Description Theo Linkspfeifer editbugs 2019-04-17 13:36:17 CEST
Right-clicking on a .odt or .ods file in Thunar does not show the "Create Archive..." entry. The entries for extracting archives are shown instead.

This bug is not present when testing with xfdesktop, so I assume that thunar-archive-plugin is not to blame.
Comment 1 Andre Miranda editbugs 2019-04-18 04:11:02 CEST
It happens because the mime tupe of odt files is "application/vnd.oasis.opendocument.text" which is a subset of "application/x-zip".

When TPA runs within Thunar it get the mime type of files and checks against a list of archive mime types, and it correctly detects that the odt is (indirectly) a zip file.

However when TPA runs within xfdesktop, it calls xfdesktop's verification function (xfdesktop_thunarx_file_info_has_mime_type), but that function is flawed, the parameters of g_content_type_is_a are swapped, the superset is passed as the type. That's why you don't see "extract here" on desktop.
I'm going to fix this on xfdesktop, so the behavior now will be the same.

Regarding the bug, technically an odt is a zip, but users are more likely willing to zip odts and not extract them.
I can only think of skipping files with certain mime types.
Comment 2 Git Bot editbugs 2019-04-18 04:12:49 CEST
Andre Miranda referenced this bugreport in commit 90631671ff1ff92ac6035d0dd3b7c9c6f3bdc88f

Fix has_mime_type implementation (Bug #15295)

https://git.xfce.org/xfce/xfdesktop/commit?id=90631671ff1ff92ac6035d0dd3b7c9c6f3bdc88f
Comment 3 Andre Miranda editbugs 2019-04-18 04:42:49 CEST
Created attachment 8418 
tap.diff

Something like this, but I don't want to include all 15 mime types[1] for each open document format, not to mention docx, xlsx, pptx, jar... Ideally there are supersets, but I couldn't find any reference on this, maybe this superset is just a glib concept.

1 - https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html
Comment 4 Theo Linkspfeifer editbugs 2019-05-14 10:48:16 CEST
I checked what Nautilus, Nemo and Caja do in this case. They simply allow the user to extract an archive, or compress it again. Both options are offered.

My vote would go for doing the same in TAP.
Comment 5 Andre Miranda editbugs 2019-05-15 04:03:47 CEST
Created attachment 8525 
tap-alway-create.diff

(In reply to Theo Linkspfeifer from comment #4)
> I checked what Nautilus, Nemo and Caja do in this case. They simply allow
> the user to extract an archive, or compress it again. Both options are
> offered.

In this case the fix is much more simpler, please check (I mean test) the attached patch, it just gets rid of an if.
Comment 6 Theo Linkspfeifer editbugs 2019-05-15 10:56:09 CEST
Tested and it works.
Comment 7 Git Bot editbugs 2019-05-15 19:40:28 CEST
Andre Miranda referenced this bugreport in commit fa3ad98d904909267501c0dd05e423bd7873835d

Allow zip files (i.e. odt, docx...) to be compressed (Bug #15295)

https://git.xfce.org/thunar-plugins/thunar-archive-plugin/commit?id=fa3ad98d904909267501c0dd05e423bd7873835d
Comment 8 Andre Miranda editbugs 2019-05-15 19:41:22 CEST
Thanks for reporting, proposing a fix and testing :)

Bug #15295

Reported by:
Theo Linkspfeifer
Reported on: 2019-04-17
Last modified on: 2019-05-15

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

tap.diff (1.29 KB, patch)
2019-04-18 04:42 CEST , Andre Miranda
no flags
tap-alway-create.diff (2.79 KB, patch)
2019-05-15 04:03 CEST , Andre Miranda
no flags

Additional information