From f3a5a5019929c2697a9356799f8972ae12fee1e8 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Tue, 18 Oct 2022 14:43:52 +0800 Subject: [PATCH] Fix: add the preset auto-copy logic at bootup sometimes the installed profiles are deleted by the installer/uninstaller add the auto-copy logic to make sure it is there after bootup Change-Id: I2e7c9eb7576672377c0f08575d17c775282f4671 --- src/slic3r/Utils/PresetUpdater.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 0d8a84d32..38734c508 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -871,6 +871,9 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const { BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:Checking whether the profile from resource is newer"; + AppConfig *app_config = GUI::wxGetApp().app_config; + const auto enabled_vendors = app_config->vendors(); + //BBS: refine the init check logic std::vector bundles; for (auto &dir_entry : boost::filesystem::directory_iterator(rsrc_path)) { @@ -883,21 +886,30 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const vendor_name.erase(vendor_name.size() - 5); if (enabled_config_update) { if ( fs::exists(path_in_vendor)) { - Semver resource_ver = get_version_from_json(file_path); - Semver vendor_ver = get_version_from_json(path_in_vendor.string()); + if (enabled_vendors.find(vendor_name) != enabled_vendors.end()) { + Semver resource_ver = get_version_from_json(file_path); + Semver vendor_ver = get_version_from_json(path_in_vendor.string()); - bool version_match = ((resource_ver.maj() == vendor_ver.maj()) && (resource_ver.min() == vendor_ver.min())); + bool version_match = ((resource_ver.maj() == vendor_ver.maj()) && (resource_ver.min() == vendor_ver.min())); - if (!version_match || (vendor_ver < resource_ver)) { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:found vendor "<