MuseScore does not register its file types on Mac

• Apr 22, 2010 - 17:08
Type
Functional
Severity
S4 - Minor
Status
closed
Project

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

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.

Status (old) active fixed

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.