Open Bug 125216 Opened 23 years ago Updated 3 years ago

FilePicker doesn't support defining a filter via a MIME type

Categories

(Core :: Widget, enhancement, P5)

enhancement

Tracking

()

People

(Reporter: jmt, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 obsolete file)

The file picker only supports defining file filter types based on extension; this is nasty. Attached is an additional IDL method, AppendMIMEFilter, whcih takes an nsIMIMEInfo as an argument. On Unix / Win32, this simply maps to an extension, but on Mac, we can extract the type and creator codes directly. I'm guessing this might be useful on other platforms too, eventually, since a MIME type is about the only cross-platform way of describing a file type.
Attached patch Extra IDL method, mac and Windows impls (obsolete) (deleted) — Splinter Review
The propsoed extension the the nsIFilePicker interface, and implementation on Mac and Windows
QA Contact: sairuh → petersen
Blocks: 97321, 152289
Just so you know, I have updated patches locally for this, the existing patch is rotten.
Comment on attachment 69225 [details] [diff] [review] Extra IDL method, mac and Windows impls Will post an updated patch if required, but it means seperating it from other mods to the file picker, so will wait till someone asks.
Attachment #69225 - Attachment is obsolete: true
In BeOS MIME support is incorporated in FS structure natively (as metadata implemented in node attributes), so i will look at that, probably next weekend
I looked at BeOS port implementation of nsFilePicker. Currently it don't use filtering. Though, at some point in future it can be easily implemented, as native BeOS file Open/Save dialog, so called BFilePanel has related class, BRefFilter, which includes boolean hook function Filter(*,*,*, const char *mimefiletype); I think that filtering wasn't implemented before because dealing with extensions in BeOS is almost useless and senseless (those are used mostly for sniffing - as workaround for externals filesystems without metadata) and needs tricking and hacking. But for mimestrings it will be very straightforward. But at moment for this bug we need (in BeOS port) only addition of simplest implementation of nsFilePicker::AppendMIMEFilter(nsIMIMEInfo *aMIMEInfo) which just adds mimestrings to list, preferably in ascii/utf-8 format.
QA Contact: chrispetersen → file-handling
Product: Core → Firefox
Version: Trunk → unspecified

The bug assignee didn't login in Bugzilla in the last 7 months.
:Gijs, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: jmt → nobody
Flags: needinfo?(gijskruitbosch+bugs)

nsIFilePicker is in Core :: Widget now.

Component: File Handling → Widget
Flags: needinfo?(gijskruitbosch+bugs)
Product: Firefox → Core

I don't expect this to get addressed anytime soon.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: