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

Fix regressions on loading broken projects #3013

Merged
merged 1 commit into from
Sep 8, 2016

Conversation

zonkmachine
Copy link
Member

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.

@@ -340,6 +340,7 @@ private slots:
QString m_fileName;
QString m_oldFileName;
bool m_modified;
bool m_loadOnLaunch;

Copy link
Member Author

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.


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(".") ) ) )
Copy link
Member Author

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.

@zonkmachine
Copy link
Member Author

Tested, works... Mergez!

@zonkmachine zonkmachine merged commit eb86e25 into LMMS:master Sep 8, 2016
@zonkmachine zonkmachine deleted the openFileFixes branch September 8, 2016 20:37
sambler added a commit to sambler/lmms that referenced this pull request Sep 19, 2016
* 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)
  ...
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
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.

1 participant