Skip to content

Commit

Permalink
Fix crash when rendering from command line and no write access to con…
Browse files Browse the repository at this point in the history
…fig file (#3413)

* Fix crash when rendering from command line and no write access to config file

* Remove redundant call to ConfigManager::addRecentlyOpenedProject()
  • Loading branch information
zonkmachine authored Mar 8, 2017
1 parent 9545f96 commit 1b6a9f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
23 changes: 15 additions & 8 deletions src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,21 @@ void ConfigManager::saveConfigFile()
QFile outfile( m_lmmsRcFile );
if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
{
QMessageBox::critical( NULL,
MainWindow::tr( "Could not save config-file" ),
MainWindow::tr( "Could not save configuration file %1. "
"You're probably not permitted to "
"write to this file.\n"
"Please make sure you have write-"
"access to the file and try again." ).
arg( m_lmmsRcFile ) );
QString title, message;
title = MainWindow::tr( "Could not open file" );
message = MainWindow::tr( "Could not open file %1 "
"for writing.\nPlease make "
"sure you have write "
"permission to the file and "
"the directory containing the "
"file and try again!"
).arg( m_lmmsRcFile );
if( gui )
{
QMessageBox::critical( NULL, title, message,
QMessageBox::Ok,
QMessageBox::NoButton );
}
return;
}

Expand Down
1 change: 0 additions & 1 deletion src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,6 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action )
const QString & f = _action->text();
setCursor( Qt::WaitCursor );
Engine::getSong()->loadProject( f );
ConfigManager::inst()->addRecentlyOpenedProject( f );
setCursor( Qt::ArrowCursor );
}
runAutoSave();
Expand Down

0 comments on commit 1b6a9f4

Please sign in to comment.