Review Request: Internal viewer: improve handling of unknown MIME types

Jonathan Marten jjm at keelhaul.me.uk
Sun Jan 1 15:26:56 UTC 2012



> On Dec. 31, 2011, 11:07 p.m., Raphael Kubo da Costa wrote:
> > Looks mostly OK, I just have a few questions below. Regarding the 'do not ask again' checkbox, I wonder if it's not going to confuse the users if they want to revert their settings.

Having the checkbox was intended for the cases where a file in an archive has a defined MIME type (i.e. not application/octet-stream), but no preview part or external application configured.  If this is the case then a user who handles such archives on a regular basis may well not want a prompt every time to view them.  Since the internal viewer is the only easy way to view files within Ark without extracting them - there is no "Open with..." function, although there may well be plans for one - using the viewer should be made as easy as possible.

Possibly needing to revert the setting is a good point, but the same could be said of any situation or application where there is a "Do not ask again" option.


> On Dec. 31, 2011, 11:07 p.m., Raphael Kubo da Costa wrote:
> > part/arkviewer.h, line 29
> > <http://git.reviewboard.kde.org/r/103110/diff/2/?file=45095#file45095line29>
> >
> >     Nit: keep the include order sorted alphabetically.

Didn't notice that this was the case originally, will fix in commit.


> On Dec. 31, 2011, 11:07 p.m., Raphael Kubo da Costa wrote:
> > part/arkviewer.cpp, lines 153-154
> > <http://git.reviewboard.kde.org/r/103110/diff/2/?file=45096#file45096line153>
> >
> >     Will the file be deleted if the code path in the else block is followed too?

Do you mean the else block

        else {
            KMessageBox::sorry(parent, i18n("The internal viewer cannot preview this file."));
            delete internalViewer;
        }

If so then, yes, it should fall through to the QFile::remove() just below.


> On Dec. 31, 2011, 11:07 p.m., Raphael Kubo da Costa wrote:
> > part/arkviewer.cpp, line 125
> > <http://git.reviewboard.kde.org/r/103110/diff/2/?file=45096#file45096line125>
> >
> >     Should the option for not asking again really be displayed?

I feel it should (see above), but can remove it if you think it is not worthwhile.


- Jonathan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103110/#review9402
-----------------------------------------------------------


On Dec. 29, 2011, 10:04 p.m., Jonathan Marten wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103110/
> -----------------------------------------------------------
> 
> (Updated Dec. 29, 2011, 10:04 p.m.)
> 
> 
> Review request for KDE Utils and Raphael Kubo da Costa.
> 
> 
> Description
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   part/arkviewer.h b810e17 
>   part/arkviewer.cpp 9bfd651 
> 
> Diff: http://git.reviewboard.kde.org/r/103110/diff/diff
> 
> 
> Testing
> -------
> 
> 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.
> 
> 
> Thanks,
> 
> Jonathan Marten
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20120101/429161e4/attachment.html>


More information about the Kde-utils-devel mailing list