Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit exit if failing to save project #4428

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

zonkmachine
Copy link
Member

Test for, and return the result of, Engine::getSong()->guiSaveProject() when saving a project.

Fixes #4426

@@ -1022,8 +1024,7 @@ bool MainWindow::saveProjectAsNewVersion()
do VersionedSaveDialog::changeFileNameVersion( fileName, true );
while ( QFile( fileName ).exists() );

Engine::getSong()->guiSaveProjectAs( fileName );
return true;
return Engine::getSong()->guiSaveProjectAs( fileName );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to make MainWindow::saveProjectAsNewVersion() return false for the purpose of testing, but the function returns a bool and this looks correct. Still works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy to test. Just create a directory with test files and change ownership to root. Load and change one of the files and then saveAsNewVersion/(). Works as expected both with and without this change.

@PhysSong
Copy link
Member

Looks good for me.
Just a reminder for branch synchronization: #4044 has changed the same part.

@zonkmachine
Copy link
Member Author

OK. I need to test this some more though.

@zonkmachine zonkmachine merged commit 583e42e into LMMS:stable-1.2 Jun 19, 2018
@zonkmachine zonkmachine deleted the savefailquitexit branch June 19, 2018 19:59
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
* Quit exiting when failing to save project

*Test outcome of save in MainWindow::saveProjectAsNewVersion()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants