Skip to content

Commit

Permalink
use function from StudyVersion class
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jun 21, 2024
1 parent 250981a commit 4c24c63
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/libs/antares/study/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ bool StudyHeader::internalLoadFromINIFile(const IniFile& ini, bool warnings)
}
}

if (validateVersion())
if (version.isSupported(true))
{
return true;
}
Expand All @@ -179,28 +179,6 @@ bool StudyHeader::internalLoadFromINIFile(const IniFile& ini, bool warnings)
return false;
}

bool StudyHeader::validateVersion()
{
if (version >= StudyVersion(7, 0))
{
if (version > Data::StudyVersion::latest())
{
logs.error() << "Header: This version is not supported (version found:"
<< version.toString()
<< ", expected: <=" << Data::StudyVersion::latest().toString() << ')';

return false;
}
}
else
{
logs.error() << "Version before 7.0 not supported, please upgrade";
return false;
}

return true;
}

bool StudyHeader::loadFromFile(const AnyString& filename, bool warnings)
{
// (Re)Initialize the internal settings
Expand Down

0 comments on commit 4c24c63

Please sign in to comment.