витязь в тигровом халате ([info]fyysik) wrote in [info]bezilla,
@ 2007-11-23 00:13:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
File handling
Crap. It appears that it is impossible to open text files from disk in branch browsers. Our file-type handling is crap.
There was old bug about it, but today I filed two new, about partial solution of global problem.

One is to get first proper mime-guessing from extensions - I have solution for that, and second, forgot number - about adding TXT extension and PLAIN_TEXT type to default mime-table in mozilla exthandler.



(Post a new comment)


[info]tqh
2007-11-23 03:37 pm UTC (link)
We have a file for translating between mozilla-mime types and BeOS ones. It is used at least for drag'n'drop so if you complete/improve it there is not much left for proper dnd.

I havn't gotten around to it myself, mostly because I find it quite boring. It needs to be done unfortunatly, this could be done without much Mozilla coding otherwise I think.

I'm on vacation until December, so can't give more info now, but will work on Firefox after that. Good to see all the activity.

(Reply to this) (Thread)

There are two aspects here
[info]fyysik
2007-11-23 04:38 pm UTC (link)
One, which allows open all supported files, is fixable via biesi-s patch:
https://bugzilla.mozilla.org/attachment.cgi?id=130690&action=edit

works well, I tested it. But there were some troubles with it, comment #7 and below:
https://bugzilla.mozilla.org/show_bug.cgi?id=217723#c7
Fortunately I figured out how to do things safe from mozilla POV:
https://bugzilla.mozilla.org/show_bug.cgi?id=217723#c22
and 'll submit updated patch ASAP.

But second aspect, quite generic in mozilla with its cross-platformity, is lookup for mime from extensions. Only proper way in BeOS for that is to use two nested loops to search BMessage received from InstalledTypes() - and then look for all types, then extensions inside types and check if it matches extension.
The patch I already submitted for bug 405023, already contains such code.

https://bugzilla.mozilla.org/attachment.cgi?id=289855&action=edit

This is tolerable for single lookup, like single file opening or single DnD event, but when it's massive, things tends to be too slow. Only solution here seems similar to solution I used in gfx for characters width measuring - hashtable, with extensions as keys, and types as data.
But it needs additional investigation and work.

(Reply to this) (Parent)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…