Don't keep a separate use_legacy_network which is error-prone. Always infer from installed plugin version. (OrcaSlicer/OrcaSlicer#14441)

This commit is contained in:
Noisyfox
2026-07-01 21:17:11 +08:00
parent ac79886c5c
commit 6b886b04f2
6 changed files with 18 additions and 25 deletions

View File

@@ -32,8 +32,6 @@ int invoke_on_all_cloud_agents(const std::map<std::string, std::shared_ptr<IClou
} // namespace
bool NetworkAgent::use_legacy_network = true;
// ============================================================================
// Static methods - delegate to BBLNetworkPlugin
// ============================================================================

View File

@@ -36,7 +36,6 @@ public:
#endif
static std::string get_version();
static void* get_network_function(const char* name);
static bool use_legacy_network;
static NetworkLibraryLoadError get_load_error();
static void clear_load_error();

View File

@@ -836,7 +836,7 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
BOOST_LOG_TRIVIAL(info) << "non need to sync plugins for there is no plugins currently.";
return;
}
std::string curr_version = NetworkAgent::use_legacy_network ? BAMBU_NETWORK_AGENT_VERSION_LEGACY : get_latest_network_version();
std::string curr_version = GUI::wxGetApp().use_legacy_network_plugin() ? BAMBU_NETWORK_AGENT_VERSION_LEGACY : get_latest_network_version();
std::string using_version = curr_version.substr(0, 9) + "00";
std::string cached_version;
@@ -931,7 +931,7 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
}
#if defined(__WINDOWS__)
if (GUI::wxGetApp().is_running_on_arm64() && !NetworkAgent::use_legacy_network) {
if (GUI::wxGetApp().is_running_on_arm64() && !GUI::wxGetApp().use_legacy_network_plugin()) {
//set to arm64 for plugins
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
current_headers["X-BBL-OS-Type"] = "windows_arm";
@@ -951,7 +951,7 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_plugins: %1%", e.what());
}
#if defined(__WINDOWS__)
if (GUI::wxGetApp().is_running_on_arm64() && !NetworkAgent::use_legacy_network) {
if (GUI::wxGetApp().is_running_on_arm64() && !GUI::wxGetApp().use_legacy_network_plugin()) {
//set back
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
current_headers["X-BBL-OS-Type"] = "windows";