mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-17 11:18:30 -04:00
Update code style for project version check.
This commit is contained in:
@@ -795,14 +795,13 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile )
|
||||
|
||||
if( root.hasAttribute( "creatorversion" ) )
|
||||
{
|
||||
//compareType defaults to Build,so it doesn't have to be set here
|
||||
// compareType defaults to Build,so it doesn't have to be set here
|
||||
ProjectVersion createdWith = root.attribute( "creatorversion" );
|
||||
ProjectVersion openedWith = LMMS_VERSION;;
|
||||
|
||||
if (createdWith != openedWith)
|
||||
if ( createdWith != openedWith )
|
||||
{
|
||||
//Only one compareType needs to be set, and "[The] ProjectVersion return type
|
||||
//from the setCompareType(...) function [...] saves a few lines of code!" (@tresf)
|
||||
// only one compareType needs to be set, and we can compare on one line because setCompareType returns ProjectVersion
|
||||
if ( createdWith.setCompareType(Minor) != openedWith)
|
||||
{
|
||||
if( Engine::hasGUI() )
|
||||
@@ -818,7 +817,7 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile )
|
||||
}
|
||||
}
|
||||
|
||||
//The upgrade needs to happen after the warning as it updates the project version.
|
||||
// the upgrade needs to happen after the warning as it updates the project version.
|
||||
if( createdWith.setCompareType(Build) < openedWith )
|
||||
{
|
||||
upgrade();
|
||||
|
||||
Reference in New Issue
Block a user