From 3f0ef7e6d95bf76e332183ca055d5a39e0a2a118 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 24 Jul 2026 12:49:23 +0800 Subject: [PATCH] Revert "feat: draft endpoint for fetching new vendor profiles" This reverts commit e7936297a1f8e8c5c2119e07e9344f5ee374868f. --- src/slic3r/Utils/PresetUpdater.cpp | 76 ------------------------------ 1 file changed, 76 deletions(-) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index c4900190f9..6d94af35d7 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1,15 +1,12 @@ #include "PresetUpdater.hpp" #include -#include #include -#include #include #include #include #include #include -#include #include #include #include @@ -22,7 +19,6 @@ #include #include -#include #include #include @@ -233,8 +229,6 @@ struct PresetUpdater::priv void parse_version_string(const std::string& body) const; void sync_resources(std::string http_url, std::map &resources, bool check_patch = false, std::string current_version="", std::string changelog_file=""); void sync_vendor_config(const std::string& vendor_id); - std::vector check_new_vendors(); - std::set get_all_system_vendors(); 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); @@ -1410,76 +1404,6 @@ void PresetUpdater::check_vendor_update(const std::string& vendor_id) }); } -// TBD the actual shape of the reponse before using this. -std::vector PresetUpdater::priv::check_new_vendors() -{ - AppConfig* app_config = GUI::wxGetApp().app_config; - std::string url = app_config->profile_update_url() + "/new?orca_version=" + Http::url_encode(SoftFever_VERSION); - - auto check_cancel = [this](Http::Progress, bool& cancel_http) { - if (cancel || vendor_check_cancel) - cancel_http = true; - }; - - std::vector vendor_ids; - const auto system_vendors = get_all_system_vendors(); - const std::vector system_vendor_list(system_vendors.begin(), system_vendors.end()); - - auto post = Http::post(url); - - post.timeout_connect(5); - post.on_progress(check_cancel); - post.on_error([](std::string body, std::string error, unsigned http_status) { - BOOST_LOG_TRIVIAL(warning) << "[Orca Updater] new vendor check HTTP error: " << error; - }) - .on_complete([&vendor_ids](std::string body, unsigned http_status) { - if (http_status != 200) - return; - try { - json j = json::parse(body); - if (j.is_array()) { - vendor_ids = j.get>(); - } - } catch (const std::exception& e) { - BOOST_LOG_TRIVIAL(warning) << "[Orca Updater] vendor check JSON parse failed: " << e.what(); - } - }); - - post.set_post_body(json(system_vendor_list).dump()); - post.perform_sync(); - - return vendor_ids; -} - -std::set PresetUpdater::priv::get_all_system_vendors() { - std::set vendors; - - PresetBundle temp_bundle; - boost::filesystem::path dir = boost::filesystem::path(resources_dir()) / "profiles"; - - for (auto& entry : boost::filesystem::directory_iterator(dir)) { - if (!Slic3r::is_json_file(entry.path().string())) - continue; - std::string vendor_name = entry.path().filename().stem().string(); - temp_bundle.load_vendor_configs_from_json(dir.string(), vendor_name, PresetBundle::LoadSystem, - ForwardCompatibilitySubstitutionRule::EnableSystemSilent); - } - - for (auto& preset : temp_bundle.printers) - if (preset.is_system) - vendors.insert(preset.vendor->name); - - for (auto& preset : temp_bundle.prints) - if (preset.is_system) - vendors.insert(preset.vendor->name); - - for (auto& preset : temp_bundle.filaments) - if (preset.is_system) - vendors.insert(preset.vendor->name); - - return vendors; -} - void PresetUpdater::slic3r_update_notify() { if (! p->enabled_version_check)