MuseScore does not register its file types on Mac
After saving a document from MuseScore v0.9.5 on Mac OS X 10.6.3, the file is not recognized by the Finder, or MuseScore. Double-clicking the document (either .mscx or .mscz files) generates a 'no default application specified' error. In addition, the application itself does not recognize the file if you drag the file icon on to the app icon.
Comments
FWIW, MuseScore 0.9.6 beta2 does NOT fix the file type registration issue.
Working on it
As r3017, MuseScore file type is registered.
I learned that the filetype are declared in the Info.plist of the application bundle. When an application is dropped in /Applications, a service reads this file and add the declared types to the OS database. (Same when removing the bundle from application I guess). Along with the filetype, a document icon, contributed by thomas, is used in the finder.
Unfortunatly, it was not enough to open a MuseScore document with MuseScore by double clicking... Even if MuseScore was already running. For the moment, MuseScore expects the name of the file to be opened as command line argument. It works great on windows and linux. Apparently, Mac has a different way of doing this. I added some code to handle the QFileOpenEvent and now, if MuseScore is opened a double click on the mscz/mscx file opens the file in MuseScore. Unfortunatly, if MuseScore is not opened, a double click will open MuseScore but not display the file.
For the reference: http://www.qtcentre.org/wiki/index.php?title=Opening_documents_in_the_M…
Maybe subclassing QApplication or QtSingleApplication is the way to go...
Should be fixed in r2030. To be tested in the RC.
Some explanations for the record:
QtSingleApplication is subclassed for mac as MuseScoreApplication.
MuseScore application implements the
event(QEvent*)
to get the QFileOpenEvent on startup. The filenames are stored until MuseScore MainWindows is created and the scores are load like the ones passed in argv on Linux and Windows.For the next files, when MuseScore is running, MuseScore QMainWindows implements eventFilter() and is installed as an eventFilter on the MuseScoreApplication to catch the QFileOpenEvent and to open the file.
Automatically closed -- issue fixed for 2 weeks with no activity.