-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix regressions on loading broken projects #3013
Conversation
@@ -340,6 +340,7 @@ private slots: | |||
QString m_fileName; | |||
QString m_oldFileName; | |||
bool m_modified; | |||
bool m_loadOnLaunch; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,song::loadProject( ... )
needs to know if the project is loaded on launch or from the gui. If there is a way to do this already we can drop this bool or if you have a better name for m_loadOnLaunch
no one is happier than me.
73ea973
to
4e481ea
Compare
4e481ea
to
9ea7f2e
Compare
|
||
DataFile dataFile( m_fileName ); | ||
// if file could not be opened, head-node is null and we create | ||
// new project | ||
if( dataFile.validate( fileName.right( fileName.lastIndexOf(".") ) ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If dataFile.validate() is needed here we could keep it in with an &&
but right now it seem to be kind of broken. The only other place that calls it is in /src/gui/FileBrowser.cpp but it doesn't seem to execute properly. Try dragging or double clicking on some random non-valid file in the "My Projects" or samples. The message box should appear but it doesn't. It does however if I invert the logic (removes the ! in the linked line above) but that's prone to crashing. For now, here, dataFile.head().isNull()
should be enough.
Tested, works... Mergez! |
* master: (213 commits) Update Pattern and AutomationPattern length (LMMS#3037) Refresh i18n strings Hint text update Drop notes with length zero (LMMS#3031) Background tweak Background Update Flanger Exclude .ts files from the Github linguist Redesign Multitap echo (LMMS#3008) Update i18n source strings Extended arpeggiator functions (LMMS#2130) Fix sample track playback in BB tracks (LMMS#3023) Sort plug-in embedded resources (LMMS#3014) Implement version major.minor.release-stage.build (LMMS#3011) Fix regressions on loading broken projects (LMMS#3013) Improved file input validation. (LMMS#2523) Fix sample track view in BB editor (LMMS#3002) Request change in model when dropping a track (LMMS#3000) Add LocklessAllocator and use it in LocklessList (LMMS#2998) Drop forceStep in AutomatableModel (LMMS#3010) ...
The original issue #781 concerned active projects being overwritten by a default project on failing to load another project.
This was closed in #1258 which worked indeed but broke handing a default project on failing to load from the command line. Also, failing to open a project, be it from the command line or gui, still sets the project title.
Enter #1838 which breaks testing of if the project could be opened. It replaces this with a suffix test. I simply revert that line.
This should fix #781 without breaking anything.