Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,33 +770,32 @@ int main( int argc, char * * argv )
}
else
{

// If enabled, open last project if there is one. Else, create
// a new one. Also skip recently opened file if limited session to
// lower the chance of opening an already opened file.
if( ConfigManager::inst()->
value( "app", "openlastproject" ).toInt() &&
!ConfigManager::inst()->recentlyOpenedProjects().isEmpty() &&
gui->mainWindow()->getSession()
!= MainWindow::SessionState::Limited )
{
QString f = ConfigManager::inst()->
recentlyOpenedProjects().first();
QFileInfo recentFile( f );

if ( recentFile.exists() )
{
Engine::getSong()->loadProject( f );
// If enabled, open last project if there is one. Else, create
// a new one. Also skip recently opened file if limited session to
// lower the chance of opening an already opened file.
if( ConfigManager::inst()->
value( "app", "openlastproject" ).toInt() &&
!ConfigManager::inst()->recentlyOpenedProjects().isEmpty() &&
gui->mainWindow()->getSession()
!= MainWindow::SessionState::Limited )
{
QString f = ConfigManager::inst()->
recentlyOpenedProjects().first();
QFileInfo recentFile( f );

if ( recentFile.exists() )
{
Engine::getSong()->loadProject( f );
}
else
{
Engine::getSong()->createNewProject();
}
}
else
{
Engine::getSong()->createNewProject();
}
}
else
{
Engine::getSong()->createNewProject();
}

// [Settel] workaround: showMaximized() doesn't work with
// FVWM2 unless the window is already visible -> show() first
Expand All @@ -806,6 +805,7 @@ int main( int argc, char * * argv )
gui->mainWindow()->showMaximized();
}
}

// Finally we start the auto save timer and also trigger the
// autosave one time as recover.mmp is a signal to possible other
// instances of LMMS.
Expand Down