From e50e6985925582b4b686793244cc88bde3515d07 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Thu, 5 Dec 2024 21:33:26 +0800 Subject: [PATCH] ENH: version: refine file version process logic only compare minor version when major equals jira: no-jira Change-Id: I0159c1b15db30238ad05b8ff7c83f6668fd11ac2 --- src/BambuStudio.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index 1d8ebd9f0..6c06edbd2 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -1678,7 +1678,7 @@ int CLI::run(int argc, char **argv) }*/ Semver cli_ver = *Semver::parse(SLIC3R_VERSION); - if (!allow_newer_file && ((cli_ver.maj() != file_version.maj()) || (cli_ver.min() < file_version.min()))){ + if (!allow_newer_file && ((cli_ver.maj() < file_version.maj()) || ((cli_ver.maj() == file_version.maj()) && (cli_ver.min() < file_version.min())))){ BOOST_LOG_TRIVIAL(error) << boost::format("Version Check: File Version %1% not supported by current cli version %2%")%file_version.to_string() %SLIC3R_VERSION; record_exit_reson(outfile_dir, CLI_FILE_VERSION_NOT_SUPPORTED, 0, cli_errors[CLI_FILE_VERSION_NOT_SUPPORTED], sliced_info); flush_and_exit(CLI_FILE_VERSION_NOT_SUPPORTED); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c5283a7ee..5b838b4f5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4366,7 +4366,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ // Is there any modifier or advanced config data? for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset(); } - } else if (load_config && (file_version > app_version)) { + } + else if (load_config && (file_version.maj() == app_version.maj()) && (file_version.min() > app_version.min())) { Semver cloud_ver; if (wxGetApp().app_config->has("app", "cloud_version")) { std::string cloud_version = wxGetApp().app_config->get("app", "cloud_version");