Bug 394744 - Dolphin cannot browse archives that are not named with the appropriate extension
Summary: Dolphin cannot browse archives that are not named with the appropriate extension
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
: 400197 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-05-27 12:10 UTC by Kishore Gopalakrishnan
Modified: 2025-03-24 22:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2018-05-27 12:10:15 UTC
If we have a zip or tar.gz archive, we can usually browse it like a folder. However, if the archive is named without an extension, we get the message 'invalid protocol' when we try to do this. However, the 'information' panel in Dolphin shows that it is correctly detected as having the relevant mime type.

Steps to reproduce:
1. Create a folder.
2. Create two text files inside it.
3. Compress the folder as zip, naming it folder.zip, or something similar.
4. Observe that you can enter the archive like a folder and view the text files inside.
5. Now, rename the archive from 'folder.zip' to 'folder' (remove the extension).
6. Now, if you try to browse the archive in Dolphin

Observed results:
For zip archives without extension, it seems to enter the folder, but does not show the contents. For tar.gz archives without extension, it does not enter the archive, and gives the error 'invalid protocol'.

Expected results:
Archives which are detected as archives by mimetype should be handled in the same way, regardless of whether they have the appropriate extension.

Possibly related: https://bugs.kde.org/show_bug.cgi?id=188989 , but this is about zip archives having a different extension, instead of having no extension.

I'm not sure if this is a bug in Dolphin or kio, so I'm filing it under Dolphin.
Comment 1 Kishore Gopalakrishnan 2018-05-27 12:11:50 UTC
I forgot to mention this: the 'extract' option also does not appear in the right-click context menu for archives which don't have an extension.
Comment 2 Kai Uwe Broulik 2018-05-28 14:24:36 UTC
Very interesting find.

KUrlNavigator is built so that it will seamlessly switch between browsing "real" folders and archives, when a URL is set, it checks for mime types and then has some special handling for ZIP and TAR archives. The interesting bit is that

QMimeDatabase mimeTypeForUrl("zip:///home/kaiuwe/Downloads/test2.zip") correctly returns application/zip whereas the same file just renamed zip:///home/kaiuwe/Downloads/test2 returns application/octet-stream and then it exits out into a folder.

(I don't know where exactly the mime type resolution happens as "zip" is not a local URL so it will probably ask KIO and then probably the archive KIO gets confused? I'm not very knowledgable about KIO internals)

Re-assigning to KIO.
Comment 3 Kishore Gopalakrishnan 2021-11-14 05:55:45 UTC
The behaviour has changed (but still does not work as expected). Now, instead of showing 'invalid protocol', it just appears to enter the zip archive (that is named without an appropriate extension) and says 'the folder is empty' (even if the archive is not empty). The 'Extract' option appears correctly (and works as expected) in the right-click menu.

Operating System: Arch Linux
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.15.2-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 21.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics
Comment 4 Kishore Gopalakrishnan 2022-03-20 10:30:44 UTC
*** Bug 400197 has been marked as a duplicate of this bug. ***