http://bugs.winehq.org/show_bug.cgi?id=25166
--- Comment #10 from Damjan Jovanovic damjan.jov@gmail.com 2010-11-17 22:49:20 CST --- Ok I found a reproducible test case. Install IrfanView and associate it with all file types for all users, then right-click a JPEG file -> 3 "Irfanview" instances.
The MIME hierarchy is:
alias image/jpeg <-----> image/pjpeg
so there's no ambiguity there.
But the files in ~/.local/share/applications do this:
$ grep image/jpeg * -i wine-extension-jfif.desktop:MimeType=image/jpeg wine-extension-jpe.desktop:MimeType=image/jpeg wine-extension-jpeg.desktop:MimeType=image/jpeg wine-extension-jpg.desktop:MimeType=image/jpeg
grep IrfanView.JPG * wine-extension-jpe.desktop:Exec=wine start /ProgIDOpen IrfanView.JPG %f wine-extension-jpeg.desktop:Exec=wine start /ProgIDOpen IrfanView.JPG %f wine-extension-jpg.desktop:Exec=wine start /ProgIDOpen IrfanView.JPG %f
Windows works by file extension and a file has exactly 1 extension, so only a single application can be started. Freedesktop works by MIME type, multiple extensions can get mapped onto the same MIME type, and then all applications for those extensions will be listed, leading to potential duplication.
Sometimes we generate a MIME type and sometimes we adopt one from Freedesktop. When we generate, the MIME type is unique to the extension and duplication is impossible. When we adopt, like we did here, multiple extensions can adopt the same one which is desirable, but multiple instances of the same application can also adopt one which is undesirable. In other words we should map Freedesktop MIME type->Wine application not Freedesktop MIME type->Wine extension.
This leads to potential ambiguity. Out of multiple extensions on Wine's side for an application, which one wins? Presumably the extension specified by Freedesktop is the best one, but (1) Freedesktop can specify multiple extensions, and (2) Wine's extensions might all differ from Freedesktop's.
I'll give this some thought.