From 6ec2ece4a4af147ef3a3c995e3651f2668782f60 Mon Sep 17 00:00:00 2001 From: Spekular Date: Tue, 27 Jan 2015 11:32:39 +0100 Subject: [PATCH] Update code style for project version check. --- src/core/DataFile.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index c39e78296..8db694367 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -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();