http://bugs.winehq.org/show_bug.cgi?id=25166
--- Comment #17 from Damjan Jovanovic damjan.jov@gmail.com 2011-02-26 01:47:19 CST --- Created an attachment (id=33454) --> (http://bugs.winehq.org/attachment.cgi?id=33454) Group by application
Here's a patch that groups all extensions/MIME types under one application. It looks very promising, however I've uncovered a problem:
Currently we open files by ProgID that's written into the .desktop file. By grouping multiple file types into the same desktop file, even when their original ProgIDs are different, we are going to open some of them with the wrong ProgID, but with the right application. I thought this didn't matter - I thought an application can't see which ProgID it was opened with - but apparently it does: opening a .dev file with Dev-C++ under the wrong ProgID of DevCpp.c causes it to display the .dev file contents, whereas using the right ProgID doesn't display the .dev file contents. Hence using the wrong ProgID has unpredictable consequences.
Only zero or one ProgIDs can be stored in a .desktop file. Multiple .desktop files, one per ProgID, is exactly what we have now.
I suppose the best options is to have Wine's start.exe determine the Freedesktop MIME type the same way that Freedesktop does (the xdg-mime command could provide that), and then a lookup table mapping MIME type to ProgID somewhere in the registry could be consulted for the Wine ProgID to use. The xdg-mime tool is somewhat out of date (it attempts to call the gnomevfs-info tool which is no longer installed in Ubuntu) so this will also take some work with Ubuntu/Portland utils/Gnome.