Correctly upgrade projects saved by LMMS forks (#6424)

* Do project file upgrades based on file version and not on LMMS version

* Do upgrade after version check
This commit is contained in:
Alex
2022-06-14 19:27:20 +02:00
committed by GitHub
parent 03571ab38d
commit ce2d898da2

View File

@@ -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"
@@ -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();
}