Skip to content

Commit

Permalink
Correctly upgrade projects saved by LMMS forks (#6424)
Browse files Browse the repository at this point in the history
* Do project file upgrades based on file version and not on LMMS version

* Do upgrade after version check
  • Loading branch information
allejok96 authored Jun 14, 2022
1 parent 03571ab commit ce2d898
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/DataFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,8 +1922,6 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile )
ProjectVersion createdWith = root.attribute("creatorversion");
ProjectVersion openedWith = LMMS_VERSION;

if (createdWith < openedWith) { upgrade(); }

if (createdWith.setCompareType(ProjectVersion::Minor)
!= openedWith.setCompareType(ProjectVersion::Minor)
&& getGUI() != nullptr && root.attribute("type") == "song"
Expand All @@ -1941,6 +1939,9 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile )
}
}

// Perform upgrade routines
if (m_fileVersion < UPGRADE_METHODS.size()) { upgrade(); }

m_content = root.elementsByTagName(typeName(m_type)).item(0).toElement();
}

Expand Down

0 comments on commit ce2d898

Please sign in to comment.