Internal viewer: improve handling of unknown MIME types

Review Request #103110 - Created Nov. 11, 2011 and submitted

Information
Jonathan Marten
ark
Reviewers
kdeutils
rkcosta
Archives often contain files which contain and are viewable as plain text, but either resolve to a MIME type that does not have a suitable viewer KPart available, or the default MIME type application/octet-stream.  Trying to view such a file is simply rejected - and there is no "Open with" operation, so it is not easily possible to open the file in KWrite or another application.

This change gives the user the option, in this case, of viewing the file as plain text - whether this is will result in a sensible display for the file is their decision.  If they want to do that, ArkViewer::viewInInternalViewer() is forced to display the file as text/plain and not to try to detect the MIME type from the file name.

The size of the internal viewer window is also saved and restored, as per the TODO comment.

This change does introduce some new GUI strings, so it will not be able to be committed until after the KDE SC 4.8 release.
Built ark with these changes, attempted to preview archive file contents for a variety of file types.  The extremely annoying "The internal viewer cannot preview this file" error message is now a thing of the past.

Issues

  • 7
  • 2
  • 0
  • 9
Description From Last Updated
- It'd be good to use i18nc() here to give translators some context. - Semantic markup would be good too. ... Raphael Kubo da Costa Raphael Kubo da Costa
This sounds like a good idea, but it is not directly related to the purpose of this request. I'd rather ... Raphael Kubo da Costa Raphael Kubo da Costa
Does this change from KRun::runUrl bring any benefits? Raphael Kubo da Costa Raphael Kubo da Costa
Why have the calls to QFile::remove been changed? It looks like the file is not being removed when it is ... Raphael Kubo da Costa Raphael Kubo da Costa
Why? Raphael Kubo da Costa Raphael Kubo da Costa
Should the option for not asking again really be displayed? Raphael Kubo da Costa Raphael Kubo da Costa
Will the file be deleted if the code path in the else block is followed too? Raphael Kubo da Costa Raphael Kubo da Costa
Raphael Kubo da Costa
Jonathan Marten
Raphael Kubo da Costa
Raphael Kubo da Costa
Commit Hook
Jonathan Marten
Review request changed

Status: Closed (submitted)

Loading...