From 38819edce4156e08e9457693290225e209aa77b1 Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 9 Feb 2026 18:37:17 +0800 Subject: [PATCH] feature add dir for store the profile on ota dir. --- src/slic3r/Utils/PresetUpdater.cpp | 54 +++++++----------------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index ba98076b51..935254683b 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -232,7 +232,11 @@ struct PresetUpdater::priv void sync_resources(std::string http_url, std::map &resources, bool check_patch = false, std::string current_version="", std::string changelog_file=""); void sync_config(bool isAuto_check = true); void sync_update_flutter_resource(bool isAuto_check = true); - bool download_file(const std::string& url, const std::string& target_path, int timeout_sec = 30, bool* cancel_flag = nullptr); + bool download_file(const std::string& url, + const std::string& target_path, + const std::string& extract_path, + int timeout_sec = 30, + bool* cancel_flag = nullptr); void sync_tooltip(std::string http_url, std::string language); void sync_plugins(std::string http_url, std::string plugin_version); void sync_printer_config(std::string http_url); @@ -656,7 +660,8 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map 0) { - //if (snapshot) { - // BOOST_LOG_TRIVIAL(info) << "Taking a snapshot..."; - // if (! GUI::Config::take_config_snapshot_cancel_on_error(*GUI::wxGetApp().app_config, Snapshot::SNAPSHOT_DOWNGRADE, "", - // _u8L("Continue and install configuration updates?"))) - // return false; - //} + BOOST_LOG_TRIVIAL(info) << format("[Orca Updater]:Deleting %1% incompatible bundles", updates.incompats.size()); for (auto &incompat : updates.incompats) { @@ -1481,12 +1479,6 @@ bool PresetUpdater::priv::perform_updates(Updates &&updates, bool snapshot) cons incompat.remove(); } } else if (updates.updates.size() > 0) { - //if (snapshot) { - // BOOST_LOG_TRIVIAL(info) << "Taking a snapshot..."; - // if (! GUI::Config::take_config_snapshot_cancel_on_error(*GUI::wxGetApp().app_config, Snapshot::SNAPSHOT_UPGRADE, "", - // _u8L("Continue and install configuration updates?"))) - // return false; - //} BOOST_LOG_TRIVIAL(info) << format("[Orca Updater]:Performing %1% updates", updates.updates.size()); @@ -1495,28 +1487,8 @@ bool PresetUpdater::priv::perform_updates(Updates &&updates, bool snapshot) cons if (update.can_install) update.install(); - //if (!update.is_directory) { - // vendor_path = update.source.parent_path().string(); - // vendor_name = update.vendor; - //} + } - - //if (!vendor_path.empty()) { - // PresetBundle bundle; - // // Throw when parsing invalid configuration. Only valid configuration is supposed to be provided over the air. - // bundle.load_vendor_configs_from_json(vendor_path, vendor_name, PresetBundle::LoadConfigBundleAttribute::LoadSystem, ForwardCompatibilitySubstitutionRule::Disable); - - // BOOST_LOG_TRIVIAL(info) << format("Deleting %1% conflicting presets", bundle.prints.size() + bundle.filaments.size() + bundle.printers.size()); - - // auto preset_remover = [](const Preset& preset) { - // BOOST_LOG_TRIVIAL(info) << '\t' << preset.file; - // fs::remove(preset.file); - // }; - - // for (const auto &preset : bundle.prints) { preset_remover(preset); } - // for (const auto &preset : bundle.filaments) { preset_remover(preset); } - // for (const auto &preset : bundle.printers) { preset_remover(preset); } - //} } return true;