diff --git a/src/libs/antares/study/header.cpp b/src/libs/antares/study/header.cpp index 4b751d75c7..ae44e94ad5 100644 --- a/src/libs/antares/study/header.cpp +++ b/src/libs/antares/study/header.cpp @@ -166,18 +166,8 @@ bool StudyHeader::internalLoadFromINIFile(const IniFile& ini, bool warnings) } } - if (version >= StudyVersion(7, 0)) + if (version.isSupported(true)) { - if (version > Data::StudyVersion::latest()) - { - if (warnings) - { - logs.error() << "Header: This version is not supported (version found:" - << version.toString() - << ", expected: <=" << Data::StudyVersion::latest().toString() << ')'; - } - return false; - } return true; } @@ -185,6 +175,7 @@ bool StudyHeader::internalLoadFromINIFile(const IniFile& ini, bool warnings) { logs.error() << "Study header: Invalid format"; } + return false; } diff --git a/src/libs/antares/study/include/antares/study/header.h b/src/libs/antares/study/include/antares/study/header.h index ec513143ec..aea7e0f35c 100644 --- a/src/libs/antares/study/include/antares/study/header.h +++ b/src/libs/antares/study/include/antares/study/header.h @@ -55,7 +55,6 @@ class StudyHeader final */ static bool readVersionFromFile(const std::filesystem::path& filename, std::string& version); -public: //! \name Constructor & Destructor //@{ /*! @@ -109,7 +108,8 @@ class StudyHeader final */ static StudyVersion tryToFindTheVersion(const std::string& folder); -public: + bool validateVersion(); + //! Caption of the study Yuni::String caption;