mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-07 10:07:38 +00:00
Merge branch 'main' into feature/bambu_printer_housekeeping
# Conflicts: # tests/slic3rutils/CMakeLists.txt
This commit is contained in:
@@ -115,15 +115,11 @@ void NetworkAgent::add_cloud_agent(const std::string& provider, std::shared_ptr<
|
||||
|
||||
void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agent)
|
||||
{
|
||||
if (!printer_agent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disconnect all callbacks from the old agent
|
||||
auto old_printer_agent = m_printer_agent;
|
||||
|
||||
m_printer_agent = std::move(printer_agent);
|
||||
m_printer_agent_id = m_printer_agent->get_agent_info().id;
|
||||
m_printer_agent_id = m_printer_agent ? m_printer_agent->get_agent_info().id : "";
|
||||
|
||||
// Disconnect the old agent's connections/threads.
|
||||
if (old_printer_agent && old_printer_agent != m_printer_agent) {
|
||||
@@ -131,6 +127,9 @@ void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agen
|
||||
apply_printer_callbacks(old_printer_agent, {});
|
||||
}
|
||||
|
||||
if (!m_printer_agent)
|
||||
return;
|
||||
|
||||
apply_printer_callbacks(m_printer_agent, m_printer_callbacks);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user