khexedit2 shows up everywhere

Friedrich W. H. Kossebau Friedrich.W.H at kossebau.de
Sun Mar 6 14:59:24 GMT 2005


Am Montag, 28. Februar 2005 01:17, schrieb David Faure:
> On Sunday 27 February 2005 23:53, Friedrich W. H. Kossebau wrote:
> > Am Samstag, 26. Februar 2005 16:12, schrieb George Staikos:
> > > khexedit2 part has mimetype of all/allfiles.  This makes it show up in
> > > konqueror as a handler for files that don't have other parts.  For
> > > instance, sites that have flash embedded will show hex editors if the
> > > user doesn't have flash installed.  This also prevents the dialog which
> > > asks the user to download flash from showing.  How do we fix this but
> > > not break the khexedit part?

Well, reducing the part to application/octet-stream was like disabling it for 
3.4.0 :/ 
I agree that though khexedit2 part not being the culprit this temporary 
solution does less harm to the overwhelming majority of users than not fixing 
it at all. But now let's head for the real fix :)

> > Perhaps by adding the option of an explicit flag when asking for a
> > mimetype handler? Explicit as in "Give me only parts who explicitly say
> > to handle the given mimetype; suppress those who handle only mimetypes
> > which are in an IS-ALSO relation to the given one". In the same way one
> > usually would not like to get the text part as fallback if there was no
> > HTML part. Would this work for all other part query usages, too?
> >
> > Implementation left to those who know about the part query system.
>
> AllowDefault=false sounds simpler to me, if that works.
> That means to let khexedit appear in the "Open With" and "Preview In"
> submenus but to not use it by default when left-clicking or embedding the
> preferred part.

This does work for Konqueror but not KHTML for me. KHTML seems to ignore the 
AllowDefault flag.

And this might have been simpler but is only a dirty workaround for the 
general problem. KHexEdit2 part may be the first to trigger this prominently 
but the same happens for e.g. embedded SVG objects: Without an installed 
SVG-part KHTML jumps in because:
* image/svg+xml tells to be X-KDE-IsAlso=text/xml
* KHTML claims to also deal text/xml 
KHTML seems to fail usually on this and only shows an empty space (which is of 
course not that distracting as viewing hex codes ;) So your user will never 
be told to install a SVG plugin :(

Test-Environment:
1. Change khexedit2part.desktop:
Revert
MimeType=application/octet-stream
to
MimeType=all/allfiles
and add
AllowDefault=false

2. Disable your SVG-Part (mv ksvgplugin.desktop ksvgplugin.desktop.hide).

3. Create test-files:
a) sometext.txt~ a backup file from some text file
b) lion.svg from kdegraphics/ksvg/tests
c) embeddedtest.html
<html>
<head></head>
<body>
some text
<object width="200" height="200"><embed src="sometext.txt~"></object>
some text
<object width="200" height="200"><embed src="lion.svg"></object>
some text
</body>
</html>

4. View in Konqueror. Hex codes for backup file, empty space for svg file.

So I still think an explicit flag would be the needed solution here. How could 
this be done? Add an built-in flag for KTrader?

Regards
Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050306/1305b712/attachment.sig>


More information about the kde-core-devel mailing list