mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-14 03:59:35 -04:00
Fix opening of project files on macOS (#3219)
- Double-click mmpz file in finder will now open properly on macOS - Adds new MainApplication class for listening to QEvent::FileOpenEvent - Queues open events until the application is ready to recieve them - Closes #665
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "MainApplication.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "NotePlayHandle.h"
|
||||
@@ -255,7 +256,7 @@ int main( int argc, char * * argv )
|
||||
|
||||
QCoreApplication * app = coreOnly ?
|
||||
new QCoreApplication( argc, argv ) :
|
||||
new QApplication( argc, argv ) ;
|
||||
new MainApplication( argc, argv );
|
||||
|
||||
Mixer::qualitySettings qs( Mixer::qualitySettings::Mode_HighQuality );
|
||||
ProjectRenderer::OutputSettings os( 44100, false, 160,
|
||||
@@ -834,6 +835,12 @@ int main( int argc, char * * argv )
|
||||
gui->mainWindow()->showMaximized();
|
||||
}
|
||||
|
||||
// Handle macOS-style FileOpen QEvents
|
||||
QString queuedFile = static_cast<MainApplication *>( app )->queuedFile();
|
||||
if ( !queuedFile.isEmpty() ) {
|
||||
fileToLoad = queuedFile;
|
||||
}
|
||||
|
||||
if( !fileToLoad.isEmpty() )
|
||||
{
|
||||
if( fileToLoad == recoveryFile )
|
||||
|
||||
Reference in New Issue
Block a user