Update code style for project version check.

This commit is contained in:
Spekular
2015-01-27 11:32:39 +01:00
parent 0847919214
commit 6ec2ece4a4

View File

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