Review Request 119877: Make it possible again to open an archive as folder with "dolphin archive.tar.gz"

Frank Reininghaus frank78ac at googlemail.com
Thu Aug 21 00:03:20 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119877/
-----------------------------------------------------------

Review request for Dolphin.


Bugs: 333078
    http://bugs.kde.org/show_bug.cgi?id=333078


Repository: kde-baseapps


Description
-------

This used to work some time ago (at least if "Open archives as folder" was enabled in the settings). I found out some time ago with git bisect that this was broken by https://git.reviewboard.kde.org/r/110487/ , but it was a mystery to me why that (apparently not really related) patch could be a problem.

I just spent some time debugging it, and it turned out that the crucial difference caused by the patch is that checking if the file is an archive is only done if the mime type is known already. This wasn't the case before that commit.

The reason why this change in DolphinViewContainer::slotItemActivated(const KFileItem& item) (and code called from there) matters at all in situations where we tell Dolphin to open a file from the command line, and nothing has actually been activated at all inside Dolphin, is the following: the function that gets called when the dir lister reports the error that it has been told to open a file (with an unsuitable protocol) calls slotItemActivated, which then tries to correct the mistake and open the file properly.

I think the best way to fix this is to handle the "file is archive" case directly in slotUrlIsFileError, and determine the mime type there. We should keep the "isMimeTypeKnown"-check in DolphinView::openItemAsFolderUrl(KFileItem, bool) to prevent GUI blocking if lots of files with unknown type are opened at the same time.

The additional benefit of this solution is that "dolphin archive.tar.gz" works even if "Open archives as folder" is disabled. So users who usually want to use Ark to handle files can use this method to open an archive inside Dolphin. (I think it's unlikely that anyone actually expects Dolphin to open Ark when entering "dolphin archive.tar.gz" on the command line.)


Diffs
-----

  dolphin/src/dolphinviewcontainer.cpp 2a45152 

Diff: https://git.reviewboard.kde.org/r/119877/diff/


Testing
-------

Fixes the problem for me. No new problems found so far.


Thanks,

Frank Reininghaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20140820/bd0c8d47/attachment.htm>


More information about the kfm-devel mailing list